2019-07-21 06:35:34 +00:00
|
|
|
# Generate code for a new function called 'run-tests' which calls in sequence
|
|
|
|
# all functions starting with 'test-'.
|
2019-08-26 06:25:08 +00:00
|
|
|
#
|
|
|
|
# To build:
|
2021-03-30 01:47:52 +00:00
|
|
|
# $ bootstrap/bootstrap translate [01]*.subx subx-params.subx tests.subx -o tests
|
2019-07-21 06:35:34 +00:00
|
|
|
|
|
|
|
== code
|
|
|
|
# instruction effective address register displacement immediate
|
|
|
|
# . op subop mod rm32 base index scale r32
|
|
|
|
# . 1-3 bytes 3 bits 2 bits 3 bits 3 bits 3 bits 2 bits 2 bits 0/1/2/4 bytes 0/1/2/4 bytes
|
|
|
|
|
2019-09-01 06:22:49 +00:00
|
|
|
Entry: # run tests if necessary, convert stdin if not
|
2019-10-16 02:35:19 +00:00
|
|
|
# . prologue
|
2019-09-01 06:22:49 +00:00
|
|
|
89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp
|
|
|
|
|
|
|
|
# initialize heap
|
|
|
|
# . Heap = new-segment(Heap-size)
|
2019-07-21 06:35:34 +00:00
|
|
|
# . . push args
|
|
|
|
68/push Heap/imm32
|
2019-11-30 19:14:49 +00:00
|
|
|
ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Heap-size/disp32 # push *Heap-size
|
2019-07-21 06:35:34 +00:00
|
|
|
# . . call
|
|
|
|
e8/call new-segment/disp32
|
|
|
|
# . . discard args
|
2019-08-26 18:55:26 +00:00
|
|
|
81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp
|
2019-07-21 06:35:34 +00:00
|
|
|
# initialize-trace-stream(256KB)
|
|
|
|
# . . push args
|
|
|
|
68/push 0x40000/imm32/256KB
|
|
|
|
# . . call
|
|
|
|
e8/call initialize-trace-stream/disp32
|
|
|
|
# . . discard args
|
2019-08-26 18:55:26 +00:00
|
|
|
81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp
|
2019-07-21 06:35:34 +00:00
|
|
|
|
|
|
|
# - if argc > 1 and argv[1] == "test", then return run_tests()
|
2019-09-01 06:22:49 +00:00
|
|
|
# if (argc <= 1) goto run-main
|
2019-08-26 18:55:26 +00:00
|
|
|
81 7/subop/compare 1/mod/*+disp8 5/rm32/ebp . . . . 0/disp8 1/imm32 # compare *ebp
|
2020-01-17 02:31:12 +00:00
|
|
|
7e/jump-if-<= $subx-tests-main:interactive/disp8
|
2019-09-01 06:22:49 +00:00
|
|
|
# if (!kernel-string-equal?(argv[1], "test")) goto run-main
|
|
|
|
# . eax = kernel-string-equal?(argv[1], "test")
|
2019-07-21 06:35:34 +00:00
|
|
|
# . . push args
|
|
|
|
68/push "test"/imm32
|
2019-08-26 18:55:26 +00:00
|
|
|
ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8)
|
2019-07-21 06:35:34 +00:00
|
|
|
# . . call
|
|
|
|
e8/call kernel-string-equal?/disp32
|
|
|
|
# . . discard args
|
2019-08-26 18:55:26 +00:00
|
|
|
81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp
|
2019-12-08 21:56:46 +00:00
|
|
|
# . if (eax == false) goto run-main
|
|
|
|
3d/compare-eax-and 0/imm32/false
|
2020-01-17 02:31:12 +00:00
|
|
|
74/jump-if-= $subx-tests-main:interactive/disp8
|
2019-09-01 06:22:49 +00:00
|
|
|
# run-tests()
|
2019-07-21 06:35:34 +00:00
|
|
|
e8/call run-tests/disp32
|
2021-07-20 14:30:59 +00:00
|
|
|
# syscall_exit(*Num-test-failures)
|
2019-08-26 18:55:26 +00:00
|
|
|
8b/copy 0/mod/indirect 5/rm32/.disp32 . . 3/r32/ebx Num-test-failures/disp32 # copy *Num-test-failures to ebx
|
2019-09-20 04:01:43 +00:00
|
|
|
eb/jump $subx-tests-main:end/disp8
|
|
|
|
$subx-tests-main:interactive:
|
2019-07-21 06:35:34 +00:00
|
|
|
# - otherwise convert stdin
|
2019-09-20 04:01:43 +00:00
|
|
|
# subx-gen-run-tests(Stdin, Stdout)
|
2019-07-21 06:35:34 +00:00
|
|
|
# . . push args
|
|
|
|
68/push Stdout/imm32
|
|
|
|
68/push Stdin/imm32
|
|
|
|
# . . call
|
2019-09-20 04:01:43 +00:00
|
|
|
e8/call subx-gen-run-tests/disp32
|
2019-07-21 06:35:34 +00:00
|
|
|
# . . discard args
|
2019-08-26 18:55:26 +00:00
|
|
|
81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp
|
2021-07-20 14:30:59 +00:00
|
|
|
# syscall_exit(0)
|
2019-08-26 18:55:26 +00:00
|
|
|
bb/copy-to-ebx 0/imm32
|
2019-09-20 04:01:43 +00:00
|
|
|
$subx-tests-main:end:
|
2020-06-11 06:09:30 +00:00
|
|
|
e8/call syscall_exit/disp32
|
2019-07-21 06:35:34 +00:00
|
|
|
|
2020-01-27 08:36:44 +00:00
|
|
|
subx-gen-run-tests: # in: (addr buffered-file), out: (addr buffered-file)
|
2019-07-21 06:35:34 +00:00
|
|
|
# pseudocode
|
2020-02-23 22:42:22 +00:00
|
|
|
# boolean tests-found = false
|
2020-01-27 08:36:44 +00:00
|
|
|
# var line: (stream byte 512)
|
2020-04-04 03:13:27 +00:00
|
|
|
# var new-code-segment-handle: (handle stream byte)
|
|
|
|
# new-stream(Segment-size, 1, new-code-stream-handle)
|
|
|
|
# var new-code-segment: (addr stream byte) = lookup(new-code-stream-handle)
|
2019-10-03 07:14:20 +00:00
|
|
|
# write(new-code-segment, "\n== code\n")
|
2019-07-21 06:35:34 +00:00
|
|
|
# write(new-code-segment, "run-tests:\n")
|
|
|
|
# while true
|
|
|
|
# clear-stream(line)
|
|
|
|
# read-line-buffered(in, line)
|
|
|
|
# if (line->write == 0) break # end of file
|
|
|
|
# var word-slice = next-word(line)
|
2020-09-16 05:21:15 +00:00
|
|
|
# if slice-empty?(word-slice) # empty line
|
|
|
|
# continue
|
2021-03-08 05:05:45 +00:00
|
|
|
# if label?(word-slice)
|
2019-07-21 06:35:34 +00:00
|
|
|
# if slice-starts-with?(word-slice, "test-")
|
|
|
|
# tests-found = true
|
|
|
|
# write(new-code-segment, " e8/call ")
|
|
|
|
# write-slice(new-code-segment, word-slice)
|
|
|
|
# write(new-code-segment, "/disp32\n")
|
|
|
|
# rewind-stream(line)
|
|
|
|
# write-stream-data(out, line)
|
|
|
|
# if tests-found
|
|
|
|
# write(new-code-segment, " c3/return\n")
|
|
|
|
# write-stream-data(out, new-code-segment)
|
|
|
|
# flush(out)
|
|
|
|
#
|
2019-10-16 02:35:19 +00:00
|
|
|
# . prologue
|
2019-08-26 18:55:26 +00:00
|
|
|
55/push-ebp
|
|
|
|
89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp
|
2019-07-21 06:35:34 +00:00
|
|
|
# . save registers
|
2019-08-26 18:55:26 +00:00
|
|
|
50/push-eax
|
|
|
|
51/push-ecx
|
|
|
|
52/push-edx
|
|
|
|
53/push-ebx
|
2020-04-04 03:13:27 +00:00
|
|
|
56/push-esi
|
2019-08-26 18:55:26 +00:00
|
|
|
57/push-edi
|
2020-01-27 08:36:44 +00:00
|
|
|
# var line/ecx: (stream byte 512)
|
2019-08-26 18:55:26 +00:00
|
|
|
81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 0x200/imm32 # subtract from esp
|
2019-07-21 06:35:34 +00:00
|
|
|
68/push 0x200/imm32/length
|
|
|
|
68/push 0/imm32/read
|
|
|
|
68/push 0/imm32/write
|
2019-08-26 18:55:26 +00:00
|
|
|
89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx
|
2020-01-27 08:36:44 +00:00
|
|
|
# var word-slice/edx: slice
|
2019-07-21 06:35:34 +00:00
|
|
|
68/push 0/imm32/end
|
|
|
|
68/push 0/imm32/start
|
2019-08-26 18:55:26 +00:00
|
|
|
89/copy 3/mod/direct 2/rm32/edx . . . 4/r32/esp . . # copy esp to edx
|
|
|
|
# tests-found?/ebx = false
|
|
|
|
31/xor 3/mod/direct 3/rm32/ebx . . . 3/r32/ebx . . # clear ebx
|
2020-04-04 03:13:27 +00:00
|
|
|
# var new-code-stream-handle/esi: (handle stream byte)
|
|
|
|
68/push 0/imm32
|
|
|
|
68/push 0/imm32
|
|
|
|
89/copy 3/mod/direct 6/rm32/esi . . . 4/r32/esp . . # copy esp to esi
|
|
|
|
# new-stream(Heap, Segment-size, 1, new-code-stream-handle)
|
2019-07-21 06:35:34 +00:00
|
|
|
# . . push args
|
2020-04-04 03:13:27 +00:00
|
|
|
56/push-esi
|
2019-07-21 06:35:34 +00:00
|
|
|
68/push 1/imm32
|
|
|
|
ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Segment-size/disp32 # push *Segment-size
|
|
|
|
68/push Heap/imm32
|
|
|
|
# . . call
|
|
|
|
e8/call new-stream/disp32
|
|
|
|
# . . discard args
|
2020-04-04 03:13:27 +00:00
|
|
|
81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32 # add to esp
|
|
|
|
# var new-code-stream/edi: (addr stream byte) = lookup(*new-code-stream-handle)
|
|
|
|
# . eax = lookup(*new-code-stream-handle)
|
|
|
|
# . . push args
|
|
|
|
ff 6/subop/push 1/mod/*+disp8 6/rm32/esi . . . . 4/disp8 . # push *(esi+4)
|
|
|
|
ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . . # push *esi
|
|
|
|
# . . call
|
|
|
|
e8/call lookup/disp32
|
|
|
|
# . . discard args
|
|
|
|
81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp
|
|
|
|
# . new-code-stream = eax
|
2019-08-26 18:55:26 +00:00
|
|
|
89/copy 3/mod/direct 7/rm32/edi . . . 0/r32/eax . . # copy eax to edi
|
2019-07-21 06:35:34 +00:00
|
|
|
# write(new-code-segment, "\n== code\n")
|
|
|
|
# . . push args
|
|
|
|
68/push "\n== code\n"/imm32
|
2019-08-26 18:55:26 +00:00
|
|
|
57/push-edi
|
2019-07-21 06:35:34 +00:00
|
|
|
# . . call
|
|
|
|
e8/call write/disp32
|
|
|
|
# . . discard args
|
2019-08-26 18:55:26 +00:00
|
|
|
81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp
|
2019-07-21 06:35:34 +00:00
|
|
|
# write(new-code-segment, "run-tests:\n")
|
|
|
|
# . . push args
|
|
|
|
68/push "run-tests:\n"/imm32
|
2019-08-26 18:55:26 +00:00
|
|
|
57/push-edi
|
2019-07-21 06:35:34 +00:00
|
|
|
# . . call
|
|
|
|
e8/call write/disp32
|
|
|
|
# . . discard args
|
2019-08-26 18:55:26 +00:00
|
|
|
81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp
|
2019-09-20 04:01:43 +00:00
|
|
|
$subx-gen-run-tests:loop:
|
2019-07-21 06:35:34 +00:00
|
|
|
# clear-stream(line)
|
|
|
|
# . . push args
|
2019-08-26 18:55:26 +00:00
|
|
|
51/push-ecx
|
2019-07-21 06:35:34 +00:00
|
|
|
# . . call
|
|
|
|
e8/call clear-stream/disp32
|
|
|
|
# . . discard args
|
2019-08-26 18:55:26 +00:00
|
|
|
81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp
|
2019-07-21 06:35:34 +00:00
|
|
|
# read-line-buffered(in, line)
|
|
|
|
# . . push args
|
2019-08-26 18:55:26 +00:00
|
|
|
51/push-ecx
|
|
|
|
ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8)
|
2019-07-21 06:35:34 +00:00
|
|
|
# . . call
|
|
|
|
e8/call read-line-buffered/disp32
|
|
|
|
# . . discard args
|
2019-08-26 18:55:26 +00:00
|
|
|
81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp
|
2019-09-20 04:01:43 +00:00
|
|
|
$subx-gen-run-tests:check0:
|
2019-07-21 06:35:34 +00:00
|
|
|
# if (line->write == 0) break
|
2019-08-26 18:55:26 +00:00
|
|
|
81 7/subop/compare 0/mod/indirect 1/rm32/ecx . . . . . 0/imm32 # compare *ecx
|
2020-01-17 02:31:12 +00:00
|
|
|
0f 84/jump-if-= $subx-gen-run-tests:break/disp32
|
2019-07-21 06:35:34 +00:00
|
|
|
# next-word(line, word-slice)
|
|
|
|
# . . push args
|
2019-08-26 18:55:26 +00:00
|
|
|
52/push-edx
|
|
|
|
51/push-ecx
|
2019-07-21 06:35:34 +00:00
|
|
|
# . . call
|
|
|
|
e8/call next-word/disp32
|
|
|
|
# . . discard args
|
2019-08-26 18:55:26 +00:00
|
|
|
81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp
|
2020-09-16 05:21:15 +00:00
|
|
|
$subx-gen-run-tests:check-empty:
|
|
|
|
# if slice-empty?(word-slice) break
|
|
|
|
# . eax = slice-empty?(word-slice)
|
|
|
|
52/push-edx
|
|
|
|
e8/call slice-empty?/disp32
|
|
|
|
# . . discard args
|
|
|
|
81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp
|
|
|
|
# . if (eax != false) break
|
|
|
|
3d/compare-eax-and 0/imm32/false
|
|
|
|
75/jump-if-!= $subx-gen-run-tests:loop/disp8
|
2019-09-20 04:01:43 +00:00
|
|
|
$subx-gen-run-tests:check-for-label:
|
2021-03-08 05:05:45 +00:00
|
|
|
# if (!label?(word-slice)) continue
|
|
|
|
# . eax = label?(word-slice)
|
2019-07-21 06:35:34 +00:00
|
|
|
# . . push args
|
2019-08-26 18:55:26 +00:00
|
|
|
52/push-edx
|
2019-07-21 06:35:34 +00:00
|
|
|
# . . call
|
2021-03-08 05:05:45 +00:00
|
|
|
e8/call label?/disp32
|
2019-07-21 06:35:34 +00:00
|
|
|
# . . discard args
|
2019-08-26 18:55:26 +00:00
|
|
|
81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp
|
2019-12-08 21:56:46 +00:00
|
|
|
# . if (eax == false) continue
|
|
|
|
3d/compare-eax-and 0/imm32/false
|
2020-01-17 02:31:12 +00:00
|
|
|
74/jump-if-= $subx-gen-run-tests:continue/disp8
|
2019-09-20 04:01:43 +00:00
|
|
|
$subx-gen-run-tests:check-label-prefix:
|
2019-07-21 06:35:34 +00:00
|
|
|
# strip trailing ':' from word-slice
|
2019-08-26 18:55:26 +00:00
|
|
|
ff 1/subop/decrement 1/mod/*+disp8 2/rm32/edx . . . . 4/disp8 . # decrement *(edx+4)
|
2019-07-21 06:35:34 +00:00
|
|
|
# if !slice-starts-with?(word-slice, "test-") continue
|
|
|
|
# . . push args
|
|
|
|
68/push "test-"/imm32
|
2019-08-26 18:55:26 +00:00
|
|
|
52/push-edx
|
2019-07-21 06:35:34 +00:00
|
|
|
# . . call
|
|
|
|
e8/call slice-starts-with?/disp32
|
|
|
|
# . . discard args
|
2019-08-26 18:55:26 +00:00
|
|
|
81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp
|
2019-12-08 21:56:46 +00:00
|
|
|
# . if (eax == false) break
|
|
|
|
3d/compare-eax-and 0/imm32/false
|
2020-01-17 02:31:12 +00:00
|
|
|
74/jump-if-= $subx-gen-run-tests:continue/disp8
|
2019-09-20 04:01:43 +00:00
|
|
|
$subx-gen-run-tests:call-test-function:
|
2019-07-21 06:35:34 +00:00
|
|
|
# tests-found? = true
|
2019-08-26 18:55:26 +00:00
|
|
|
bb/copy-to-ebx 1/imm32/true
|
2019-07-21 06:35:34 +00:00
|
|
|
# write(new-code-segment, " e8/call ")
|
|
|
|
# . . push args
|
|
|
|
68/push " e8/call "/imm32
|
2019-08-26 18:55:26 +00:00
|
|
|
57/push-edi
|
2019-07-21 06:35:34 +00:00
|
|
|
# . . call
|
|
|
|
e8/call write/disp32
|
|
|
|
# . . discard args
|
2019-08-26 18:55:26 +00:00
|
|
|
81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp
|
2019-07-21 06:35:34 +00:00
|
|
|
# write-slice(new-code-segment, word-slice)
|
|
|
|
# . . push args
|
2019-08-26 18:55:26 +00:00
|
|
|
52/push-edx
|
|
|
|
57/push-edi
|
2019-07-21 06:35:34 +00:00
|
|
|
# . . call
|
|
|
|
e8/call write-slice/disp32
|
|
|
|
# . . discard args
|
2019-08-26 18:55:26 +00:00
|
|
|
81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp
|
2019-07-21 06:35:34 +00:00
|
|
|
# write(new-code-segment, "/disp32\n")
|
|
|
|
# . . push args
|
|
|
|
68/push "/disp32\n"/imm32
|
2019-08-26 18:55:26 +00:00
|
|
|
57/push-edi
|
2019-07-21 06:35:34 +00:00
|
|
|
# . . call
|
|
|
|
e8/call write/disp32
|
|
|
|
# . . discard args
|
2019-08-26 18:55:26 +00:00
|
|
|
81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp
|
2019-09-20 04:01:43 +00:00
|
|
|
$subx-gen-run-tests:continue:
|
2019-07-21 06:35:34 +00:00
|
|
|
# rewind-stream(line)
|
|
|
|
# . . push args
|
2019-08-26 18:55:26 +00:00
|
|
|
51/push-ecx
|
2019-07-21 06:35:34 +00:00
|
|
|
# . . call
|
|
|
|
e8/call rewind-stream/disp32
|
|
|
|
# . . discard args
|
2019-08-26 18:55:26 +00:00
|
|
|
81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp
|
2019-07-21 06:35:34 +00:00
|
|
|
# write-stream-data(out, line)
|
|
|
|
# . . push args
|
2019-08-26 18:55:26 +00:00
|
|
|
51/push-ecx
|
|
|
|
ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12)
|
2019-07-21 06:35:34 +00:00
|
|
|
# . . call
|
|
|
|
e8/call write-stream-data/disp32
|
|
|
|
# . . discard args
|
2019-08-26 18:55:26 +00:00
|
|
|
81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp
|
2019-07-21 06:35:34 +00:00
|
|
|
# loop
|
2019-09-20 04:01:43 +00:00
|
|
|
e9/jump $subx-gen-run-tests:loop/disp32
|
|
|
|
$subx-gen-run-tests:break:
|
2019-07-21 06:35:34 +00:00
|
|
|
# if (!tests-found?) goto end
|
2019-12-08 21:56:46 +00:00
|
|
|
81 7/subop/compare 3/mod/direct 3/rm32/ebx . . . . . 0/imm32/false # compare ebx
|
2020-01-17 02:31:12 +00:00
|
|
|
74/jump-if-= $subx-gen-run-tests:end/disp8
|
2019-07-21 06:35:34 +00:00
|
|
|
# write(new-code-segment, " c3/return\n")
|
|
|
|
# . . push args
|
|
|
|
68/push " c3/return\n"/imm32
|
2019-08-26 18:55:26 +00:00
|
|
|
57/push-edi
|
2019-07-21 06:35:34 +00:00
|
|
|
# . . call
|
|
|
|
e8/call write/disp32
|
|
|
|
# . . discard args
|
2019-08-26 18:55:26 +00:00
|
|
|
81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp
|
2019-07-21 06:35:34 +00:00
|
|
|
# write-stream-data(out, new-code-segment)
|
|
|
|
# . . push args
|
2019-08-26 18:55:26 +00:00
|
|
|
57/push-edi
|
|
|
|
ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12)
|
2019-07-21 06:35:34 +00:00
|
|
|
# . . call
|
|
|
|
e8/call write-stream-data/disp32
|
|
|
|
# . . discard args
|
2019-08-26 18:55:26 +00:00
|
|
|
81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp
|
2019-09-20 04:01:43 +00:00
|
|
|
$subx-gen-run-tests:end:
|
2019-07-21 06:35:34 +00:00
|
|
|
# flush(out)
|
|
|
|
# . . push args
|
2019-08-26 18:55:26 +00:00
|
|
|
ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12)
|
2019-07-21 06:35:34 +00:00
|
|
|
# . . call
|
|
|
|
e8/call flush/disp32
|
|
|
|
# . . discard args
|
2019-08-26 18:55:26 +00:00
|
|
|
81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp
|
2019-07-21 06:35:34 +00:00
|
|
|
# . reclaim locals
|
2020-04-04 03:13:27 +00:00
|
|
|
81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x21c/imm32 # add to esp
|
2019-07-21 06:35:34 +00:00
|
|
|
# . restore registers
|
2019-08-26 18:55:26 +00:00
|
|
|
5f/pop-to-edi
|
2020-04-04 03:13:27 +00:00
|
|
|
5e/pop-to-esi
|
2019-08-26 18:55:26 +00:00
|
|
|
5b/pop-to-ebx
|
|
|
|
5a/pop-to-edx
|
|
|
|
59/pop-to-ecx
|
|
|
|
58/pop-to-eax
|
2019-10-16 02:35:19 +00:00
|
|
|
# . epilogue
|
2019-08-26 18:55:26 +00:00
|
|
|
89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . . # copy ebp to esp
|
|
|
|
5d/pop-to-ebp
|
2019-07-21 06:35:34 +00:00
|
|
|
c3/return
|
|
|
|
|
|
|
|
# . . vim:nowrap:textwidth=0
|