diff options
Diffstat (limited to '066print-int.subx')
-rw-r--r-- | 066print-int.subx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/066print-int.subx b/066print-int.subx index cf043635..a1f968f7 100644 --- a/066print-int.subx +++ b/066print-int.subx @@ -5,7 +5,8 @@ # . 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 -to-hex-char: # in/eax : nibble -> out/eax : byte +# convert the lowest nibble of eax to ascii and return it in the lowest byte of eax +to-hex-char: # in/eax : int -> out/eax : int # no error checking; accepts argument in eax # if (eax <= 9) return eax + '0' 3d/compare-eax-with 0x9/imm32/9 @@ -17,7 +18,7 @@ $to-hex-char:else: 05/add-to-eax 0x57/imm32/a-10 c3/return -append-byte-hex: # f : (address stream), n : int +append-byte-hex: # f : (address stream byte), n : int # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -174,7 +175,7 @@ test-print-byte-buffered: # . end c3/return -print-int32: # f : (address stream), n : int +print-int32: # f : (address stream byte), n : int # pseudocode: # write(f, "0x") # ecx = 28 |