diff options
author | Kartik Agaram <vc@akkartik.com> | 2019-07-09 23:47:20 -0700 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2019-07-09 23:47:20 -0700 |
commit | 57714dd4fc385b51e879569f8df2eb61ff1f3154 (patch) | |
tree | b33aa11b58b4c871b1dd7dd4cd693481f80a9624 | |
parent | 48aabc860ad7acd5ad76300f99c66e529b2555d5 (diff) | |
download | mu-57714dd4fc385b51e879569f8df2eb61ff1f3154.tar.gz |
.
-rw-r--r-- | subx/apps/subx-common.subx | 106 |
1 files changed, 69 insertions, 37 deletions
diff --git a/subx/apps/subx-common.subx b/subx/apps/subx-common.subx index aa6498c1..5ddc8cb2 100644 --- a/subx/apps/subx-common.subx +++ b/subx/apps/subx-common.subx @@ -2382,94 +2382,122 @@ test-compute-width: 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP $test-compute-width:imm8: # EAX = compute-width("0x2/imm8") - 68/push "0x2/imm8"/imm32 + # . . push args + 68/push "0x2/imm8"/imm32 + # . . call e8/call compute-width/disp32 - # . discard args + # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP # check-ints-equal(EAX, 1, msg) - 68/push "F - test-compute-width: 0x2/imm8"/imm32 + # . . push args + 68/push "F - test-compute-width: 0x2/imm8"/imm32 50/push-EAX - 68/push 1/imm32 + 68/push 1/imm32 + # . . call e8/call check-ints-equal/disp32 - # . discard args + # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP $test-compute-width:imm16: # EAX = compute-width("4/imm16") - 68/push "4/imm16"/imm32 + # . . push args + 68/push "4/imm16"/imm32 + # . . call e8/call compute-width/disp32 - # . discard args + # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP # check-ints-equal(EAX, 2, msg) - 68/push "F - test-compute-width: 4/imm16"/imm32 + # . . push args + 68/push "F - test-compute-width: 4/imm16"/imm32 50/push-EAX - 68/push 2/imm32 + 68/push 2/imm32 + # . . call e8/call check-ints-equal/disp32 - # . discard args + # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP $test-compute-width:imm32: # EAX = compute-width("4/imm32") - 68/push "4/imm32"/imm32 + # . . push args + 68/push "4/imm32"/imm32 + # . . call e8/call compute-width/disp32 - # . discard args + # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP # check-ints-equal(EAX, 4, msg) - 68/push "F - test-compute-width: 4/imm32"/imm32 + # . . push args + 68/push "F - test-compute-width: 4/imm32"/imm32 50/push-EAX - 68/push 4/imm32 + 68/push 4/imm32 + # . . call e8/call check-ints-equal/disp32 - # . discard args + # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP $test-compute-width:disp8: # EAX = compute-width("foo/disp8") - 68/push "foo/disp8"/imm32 + # . . push args + 68/push "foo/disp8"/imm32 + # . . call e8/call compute-width/disp32 - # . discard args + # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP # check-ints-equal(EAX, 1, msg) - 68/push "F - test-compute-width: foo/disp8"/imm32 + # . . push args + 68/push "F - test-compute-width: foo/disp8"/imm32 50/push-EAX - 68/push 1/imm32 + 68/push 1/imm32 + # . . call e8/call check-ints-equal/disp32 - # . discard args + # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP $test-compute-width:disp16: # EAX = compute-width("foo/disp16") - 68/push "foo/disp16"/imm32 + # . . push args + 68/push "foo/disp16"/imm32 + # . . call e8/call compute-width/disp32 - # . discard args + # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP # check-ints-equal(EAX, 2, msg) - 68/push "F - test-compute-width: foo/disp16"/imm32 + # . . push args + 68/push "F - test-compute-width: foo/disp16"/imm32 50/push-EAX - 68/push 2/imm32 + 68/push 2/imm32 + # . . call e8/call check-ints-equal/disp32 - # . discard args + # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP $test-compute-width:disp32: # EAX = compute-width("foo/disp32") - 68/push "foo/disp32"/imm32 + # . . push args + 68/push "foo/disp32"/imm32 + # . . call e8/call compute-width/disp32 - # . discard args + # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP # check-ints-equal(EAX, 4, msg) - 68/push "F - test-compute-width: foo/disp32"/imm32 + # . . push args + 68/push "F - test-compute-width: foo/disp32"/imm32 50/push-EAX - 68/push 4/imm32 + 68/push 4/imm32 + # . . call e8/call check-ints-equal/disp32 - # . discard args + # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP $test-compute-width:no-metadata: # EAX = compute-width("45") - 68/push "45"/imm32 + # . . push args + 68/push "45"/imm32 + # . . call e8/call compute-width/disp32 - # . discard args + # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP # check-ints-equal(EAX, 1, msg) - 68/push "F - test-compute-width: 45 (no metadata)"/imm32 + # . . push args + 68/push "F - test-compute-width: 45 (no metadata)"/imm32 50/push-EAX - 68/push 1/imm32 + 68/push 1/imm32 + # . . call e8/call check-ints-equal/disp32 - # . discard args + # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP # . epilog 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . . # copy EBP to ESP @@ -2519,9 +2547,11 @@ $test-is-label?:true: 50/push-EAX 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . . # copy ESP to ECX # is-label?(slice/ECX) + # . . push args 51/push-ECX + # . . call e8/call is-label?/disp32 - # . discard args + # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP # check-ints-equal(EAX, 1, msg) # . . push args @@ -2543,9 +2573,11 @@ $test-is-label?:false: 50/push-EAX 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . . # copy ESP to ECX # is-label?(slice/ECX) + # . . push args 51/push-ECX + # . . call e8/call is-label?/disp32 - # . discard args + # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP # check-ints-equal(EAX, 0, msg) # . . push args |