4770
This commit is contained in:
parent
4aff81ec03
commit
ba196240ff
|
@ -29,7 +29,7 @@
|
|||
# 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
|
||||
|
||||
# main:
|
||||
# main: run tests if necessary, call 'compile' if not
|
||||
# prolog
|
||||
89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP
|
||||
# if (argc > 1)
|
||||
|
@ -52,10 +52,10 @@
|
|||
eb/jump $main:end/disp8
|
||||
$run-main:
|
||||
# allocate space for an exit-descriptor
|
||||
# var ed/EAX : (address exit-descriptor)
|
||||
# var ed/EAX : (address exit-descriptor)
|
||||
81 5/subop/subtract 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # subtract from ESP
|
||||
8d/copy-address 0/mod/indirect 4/rm32/sib 4/base/ESP 4/index/none . 0/r32/EAX . . # copy ESP to EAX
|
||||
# clear ed->target (so we really exit)
|
||||
# clear ed->target (so we really exit)
|
||||
c7/copy 0/mod/direct 0/rm32/EAX . . . . . 0/imm32 # copy to *EAX
|
||||
# expected(ed, 2/stderr, "integer")
|
||||
# push args
|
||||
|
@ -273,7 +273,7 @@ test-get-num-reads-single-digit:
|
|||
# push args
|
||||
68/push _test-buffered-file/imm32
|
||||
# call
|
||||
e8/call get-char/disp32
|
||||
e8/call get-char/disp32
|
||||
# discard args
|
||||
81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP
|
||||
## get-num(in, out, err, ed)
|
||||
|
@ -453,7 +453,7 @@ test-get-num-reads-multiple-digits:
|
|||
# push args
|
||||
68/push _test-buffered-file/imm32
|
||||
# call
|
||||
e8/call get-char/disp32
|
||||
e8/call get-char/disp32
|
||||
# discard args
|
||||
81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP
|
||||
## get-num(in, out, err, ed)
|
||||
|
@ -546,7 +546,7 @@ test-get-num-reads-multiple-digits-followed-by-nondigit:
|
|||
# push args
|
||||
68/push _test-buffered-file/imm32
|
||||
# call
|
||||
e8/call get-char/disp32
|
||||
e8/call get-char/disp32
|
||||
# discard args
|
||||
81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP
|
||||
## get-num(in, out, err, ed)
|
||||
|
|
Loading…
Reference in New Issue