diff options
author | Kartik Agaram <vc@akkartik.com> | 2018-12-06 09:41:40 -0800 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2018-12-06 09:41:40 -0800 |
commit | 81605224f085ec85ea11302c938a53cf2dd8a2bc (patch) | |
tree | 2c5840f43d01f69ae7acde462fd7bbbc971a4db3 /subx/apps | |
parent | 33e7c3a75196fbf8bd8412eda797cfa170eb189d (diff) | |
download | mu-81605224f085ec85ea11302c938a53cf2dd8a2bc.tar.gz |
4847
Diffstat (limited to 'subx/apps')
-rw-r--r-- | subx/apps/crenshaw2-1.subx | 8 | ||||
-rw-r--r-- | subx/apps/crenshaw2-1b.subx | 8 | ||||
-rw-r--r-- | subx/apps/factorial.subx | 2 | ||||
-rw-r--r-- | subx/apps/hex.subx | 10 |
4 files changed, 14 insertions, 14 deletions
diff --git a/subx/apps/crenshaw2-1.subx b/subx/apps/crenshaw2-1.subx index 25bc897b..6feabcfb 100644 --- a/subx/apps/crenshaw2-1.subx +++ b/subx/apps/crenshaw2-1.subx @@ -44,7 +44,7 @@ # . argv[1] == "test" # . . push args 68/push "test"/imm32 - ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0x8/disp8 . # push *(EBP+8) + ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 8/disp8 . # push *(EBP+8) # . . call e8/call kernel-string-equal/disp32 # . . discard args @@ -538,7 +538,7 @@ get-char: # f : (address buffered-file) -> <void> 50/push-EAX # read-byte(f) # . . push args - ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0x8/disp8 . # push *(EBP+8) + ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 8/disp8 . # push *(EBP+8) # . . call e8/call read-byte/disp32 # . . discard args @@ -560,10 +560,10 @@ is-digit?: # c : int -> bool/EAX # EAX = false b8/copy-to-EAX 0/imm32 # if c < '0' return false - 81 7/subop/compare 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0x8/disp8 0x30/imm32 # compare *(EBP+8) + 81 7/subop/compare 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 8/disp8 0x30/imm32 # compare *(EBP+8) 7c/jump-if-lesser $is-digit?:end/disp8 # if c > '9' return false - 81 7/subop/compare 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0x8/disp8 0x39/imm32 # compare *(EBP+8) + 81 7/subop/compare 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 8/disp8 0x39/imm32 # compare *(EBP+8) 7f/jump-if-greater $is-digit?:end/disp8 # otherwise return true b8/copy-to-EAX 1/imm32 diff --git a/subx/apps/crenshaw2-1b.subx b/subx/apps/crenshaw2-1b.subx index eec78f85..0b4fc27c 100644 --- a/subx/apps/crenshaw2-1b.subx +++ b/subx/apps/crenshaw2-1b.subx @@ -44,7 +44,7 @@ # . argv[1] == "test" # . . push args 68/push "test"/imm32 - ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0x8/disp8 . # push *(EBP+8) + ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 8/disp8 . # push *(EBP+8) # . . call e8/call kernel-string-equal/disp32 # . . discard args @@ -736,7 +736,7 @@ get-char: # f : (address buffered-file) -> <void> 50/push-EAX # read-byte(f) # . . push args - ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0x8/disp8 . # push *(EBP+8) + ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 8/disp8 . # push *(EBP+8) # . . call e8/call read-byte/disp32 # . . discard args @@ -757,10 +757,10 @@ is-digit?: # c : int -> bool/EAX # EAX = false b8/copy-to-EAX 0/imm32 # if c < '0' return false - 81 7/subop/compare 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0x8/disp8 0x30/imm32 # compare *(EBP+8) + 81 7/subop/compare 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 8/disp8 0x30/imm32 # compare *(EBP+8) 7c/jump-if-lesser $is-digit?:end/disp8 # if c > '9' return false - 81 7/subop/compare 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0x8/disp8 0x39/imm32 # compare *(EBP+8) + 81 7/subop/compare 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 8/disp8 0x39/imm32 # compare *(EBP+8) 7f/jump-if-greater $is-digit?:end/disp8 # otherwise return true b8/copy-to-EAX 1/imm32 diff --git a/subx/apps/factorial.subx b/subx/apps/factorial.subx index 73735fab..bd73d72b 100644 --- a/subx/apps/factorial.subx +++ b/subx/apps/factorial.subx @@ -29,7 +29,7 @@ # . argv[1] == "test" # . . push args 68/push "test"/imm32 - ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0x8/disp8 . # push *(EBP+8) + ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 8/disp8 . # push *(EBP+8) # . . call e8/call kernel-string-equal/disp32 # . . discard args diff --git a/subx/apps/hex.subx b/subx/apps/hex.subx index e0963a7e..c5429285 100644 --- a/subx/apps/hex.subx +++ b/subx/apps/hex.subx @@ -31,7 +31,7 @@ # . argv[1] == "test" # . . push args 68/push "test"/imm32 - ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0x8/disp8 . # push *(EBP+8) + ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 8/disp8 . # push *(EBP+8) # . . call e8/call kernel-string-equal/disp32 # . . discard args @@ -131,7 +131,7 @@ scan-next-byte: # in : (address buffered-file), err : (address buffered-file), $scan-next-byte:loop: # EAX = read-byte(in) # . . push args - ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0x8/disp8 . # push *(EBP+8) + ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 8/disp8 . # push *(EBP+8) # . . call e8/call read-byte/disp32 # . . discard args @@ -168,7 +168,7 @@ $scan-next-byte:check2: 75/jump-if-not-equal $scan-next-byte:check3/disp8 # . skip-until-newline(in) # . . push args - ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0x8/disp8 . # push *(EBP+8) + ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 8/disp8 . # push *(EBP+8) # . . call e8/call skip-until-newline/disp32 # . . discard args @@ -804,7 +804,7 @@ is-hex-lowercase-byte?: # c : byte -> bool/EAX # . save registers 51/push-ECX # ECX = c - 8b/copy 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . 1/r32/ECX 0x8/disp8 . # copy *(EBP+8) to ECX + 8b/copy 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . 1/r32/ECX 8/disp8 . # copy *(EBP+8) to ECX # return false if c < '0' b8/copy-to-EAX 0/imm32/false 81 7/subop/compare 3/mod/direct 1/rm32/ECX . . . . . 0x30/imm32 # compare ECX @@ -972,7 +972,7 @@ skip-until-newline: # in : (address buffered-file) -> <void> $skip-until-newline:loop: # . EAX = read-byte(in) # . . push args - ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 0x8/disp8 . # push *(EBP+8) + ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 8/disp8 . # push *(EBP+8) # . . call e8/call read-byte/disp32 # . . discard args |