diff options
-rw-r--r-- | subx/051test.subx | 6 | ||||
-rw-r--r-- | subx/053new_segment.subx | 4 | ||||
-rw-r--r-- | subx/055trace.subx | 4 | ||||
-rw-r--r-- | subx/057stop.subx | 8 | ||||
-rw-r--r-- | subx/apps/crenshaw2-1.subx | 12 | ||||
-rw-r--r-- | subx/apps/factorial.subx | 10 | ||||
-rw-r--r-- | subx/examples/ex11.subx | 6 |
7 files changed, 25 insertions, 25 deletions
diff --git a/subx/051test.subx b/subx/051test.subx index d291defe..273a5ec5 100644 --- a/subx/051test.subx +++ b/subx/051test.subx @@ -38,7 +38,7 @@ check-ints-equal: # (a : int, b : int, msg : (address array byte)) -> boolean 68/push 2/imm32/stderr # call e8/call _write/disp32 - # discard arg + # discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP # return eb/jump $check-ints-equal:end/disp8 @@ -52,7 +52,7 @@ $check-ints-equal:else: 68/push 2/imm32/stderr # call e8/call _write/disp32 - # discard arg + # discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP # print newline # push args @@ -60,7 +60,7 @@ $check-ints-equal:else: 68/push 2/imm32/stderr # call e8/call _write/disp32 - # discard arg + # discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP # increment Num-test-failures ff 0/subop/increment 0/mod/indirect 5/rm32/.disp32 . . . Num-test-failures/disp32 # increment *Num-test-failures diff --git a/subx/053new_segment.subx b/subx/053new_segment.subx index f8524964..70acb572 100644 --- a/subx/053new_segment.subx +++ b/subx/053new_segment.subx @@ -8,11 +8,11 @@ # main: (manual test if this is the last file loaded) # EAX = new-segment(0x1000) - # push arg + # push args 68/push 0x1000/imm32 # call e8/call new-segment/disp32 - # discard arg + # discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP # store to *EAX diff --git a/subx/055trace.subx b/subx/055trace.subx index d09fd905..e61d5097 100644 --- a/subx/055trace.subx +++ b/subx/055trace.subx @@ -54,11 +54,11 @@ Test-trace-stream: # The Trace-stream segment will consist of variable-length lines separated by newlines (0x0a) initialize-trace-stream: # EAX = new-segment(0x1000) - # push arg + # push args 68/push 0x1000/imm32/N # call e8/call new-segment/disp32 - # discard arg + # discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP # copy EAX to *Trace-stream 89/copy 0/mod/indirect 5/rm32/.disp32 . . 0/r32/EAX Trace-stream/disp32 # copy EAX to *Trace-stream diff --git a/subx/057stop.subx b/subx/057stop.subx index 8530ced6..a9e454b6 100644 --- a/subx/057stop.subx +++ b/subx/057stop.subx @@ -134,12 +134,12 @@ test-stop-skips-returns-on-exit: # discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP # call _test-stop-1(ed) - # push arg + # push args 50/push-EAX # call e8/call _test-stop-1/disp32 ## registers except ESP may be clobbered at this point - # restore arg + # restore args 58/pop-to-EAX # check that _test-stop-1 tried to call exit(1) # check-ints-equal(ed->value, 2, msg) # i.e. stop was called with value 1 @@ -163,12 +163,12 @@ _test-stop-1: # ed : (address exit-descriptor) 55/push-EBP 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP # _test-stop-2(ed) - # push arg + # push args ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 8/disp8 . # push *(EBP+8) # call e8/call _test-stop-2/disp32 ## should never get past this point - # discard arg + # discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP # signal test failed: check-ints-equal(1, 0, msg) # push args diff --git a/subx/apps/crenshaw2-1.subx b/subx/apps/crenshaw2-1.subx index 259b33a9..6832c6d5 100644 --- a/subx/apps/crenshaw2-1.subx +++ b/subx/apps/crenshaw2-1.subx @@ -40,8 +40,8 @@ 50/push-EAX # call e8/call expected/disp32 - # discard arg - 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP + # discard args + 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP # syscall(exit, 0) bb/copy-to-EBX 0/imm32 b8/copy-to-EAX 1/imm32/exit @@ -59,7 +59,7 @@ expected: # ed : (address exit-descriptor), f : fd or (address stream), s : (ad ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0xc/disp8 . # push *(EBP+12) # call e8/call write/disp32 - # discard arg + # discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP # write(f, s) # push args @@ -67,7 +67,7 @@ expected: # ed : (address exit-descriptor), f : fd or (address stream), s : (ad ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0xc/disp8 . # push *(EBP+12) # call e8/call write/disp32 - # discard arg + # discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP # write(f, " expected") # push args @@ -75,7 +75,7 @@ expected: # ed : (address exit-descriptor), f : fd or (address stream), s : (ad ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0xc/disp8 . # push *(EBP+12) # call e8/call write/disp32 - # discard arg + # discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP # write(f, Newline) # push args @@ -83,7 +83,7 @@ expected: # ed : (address exit-descriptor), f : fd or (address stream), s : (ad ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0xc/disp8 . # push *(EBP+12) # call e8/call write/disp32 - # discard arg + # discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP # stop(ed, 1) # push args diff --git a/subx/apps/factorial.subx b/subx/apps/factorial.subx index 282ec9ae..43a61dcf 100644 --- a/subx/apps/factorial.subx +++ b/subx/apps/factorial.subx @@ -42,11 +42,11 @@ eb/jump $main:end/disp8 # where EAX will get copied to EBX # else EAX = factorial(5) $run-main: - # push arg + # push args 68/push 5/imm32 # call e8/call factorial/disp32 - # discard arg + # discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP $main:end: # exit(EAX) @@ -73,7 +73,7 @@ factorial: 53/push-EBX # call e8/call factorial/disp32 - # discard arg + # discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP # return n * factorial(n-1) f7 4/subop/multiply 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none 8/disp8 . # multiply *(EBP+8) into EAX @@ -87,11 +87,11 @@ $factorial:end: test-factorial: # factorial(5) - # push arg + # push args 68/push 5/imm32 # call e8/call factorial/disp32 - # discard arg + # discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP # check-ints-equal(EAX, 120, failure message) # push args diff --git a/subx/examples/ex11.subx b/subx/examples/ex11.subx index cd8cdf4d..dc804ebe 100644 --- a/subx/examples/ex11.subx +++ b/subx/examples/ex11.subx @@ -272,7 +272,7 @@ check-ints-equal: # (a : int, b : int, msg : (address array byte)) -> boolean 68/push "."/imm32 # call e8/call write-stderr/disp32 - # discard arg + # discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP # return eb/jump $check-ints-equal:end/disp8 @@ -285,14 +285,14 @@ $check-ints-equal:else: 51/push-ECX # call e8/call write-stderr/disp32 - # discard arg + # discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP # print newline # push args 68/push Newline/imm32 # call e8/call write-stderr/disp32 - # discard arg + # discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP $check-ints-equal:end: # restore registers |