diff options
author | Kartik Agaram <vc@akkartik.com> | 2019-07-21 22:23:20 -0700 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2019-07-21 22:23:20 -0700 |
commit | ac8a9396b96259ed2d068abf30863540a21648f3 (patch) | |
tree | b2fdf8988014b2ebc2fa2bd8fc733d03d3f1fa0f | |
parent | 8a1a3fb45f390d3142556802e0f0ea671a799da1 (diff) | |
download | mu-ac8a9396b96259ed2d068abf30863540a21648f3.tar.gz |
5437
Break a dependency from `print-int32` to `from-hex-char`.
-rw-r--r-- | subx/065write-buffered.subx (renamed from subx/066write-buffered.subx) | 0 | ||||
-rw-r--r-- | subx/066print-int.subx (renamed from subx/067print-int.subx) | 12 | ||||
-rw-r--r-- | subx/067parse-hex.subx (renamed from subx/065hex.subx) | 14 | ||||
-rwxr-xr-x | subx/apps/assort | bin | 34167 -> 34167 bytes | |||
-rwxr-xr-x | subx/apps/crenshaw2-1 | bin | 24575 -> 24575 bytes | |||
-rwxr-xr-x | subx/apps/crenshaw2-1b | bin | 25134 -> 25134 bytes | |||
-rwxr-xr-x | subx/apps/dquotes | bin | 40723 -> 40723 bytes | |||
-rwxr-xr-x | subx/apps/factorial | bin | 23491 -> 23491 bytes | |||
-rwxr-xr-x | subx/apps/handle | bin | 24350 -> 24350 bytes | |||
-rwxr-xr-x | subx/apps/hex | bin | 27584 -> 27584 bytes | |||
-rwxr-xr-x | subx/apps/pack | bin | 46819 -> 46819 bytes | |||
-rwxr-xr-x | subx/apps/survey | bin | 42817 -> 42817 bytes | |||
-rwxr-xr-x | subx/apps/tests | bin | 32979 -> 32979 bytes |
13 files changed, 13 insertions, 13 deletions
diff --git a/subx/066write-buffered.subx b/subx/065write-buffered.subx index 35f75199..35f75199 100644 --- a/subx/066write-buffered.subx +++ b/subx/065write-buffered.subx diff --git a/subx/067print-int.subx b/subx/066print-int.subx index c9b8d2e4..c5968837 100644 --- a/subx/067print-int.subx +++ b/subx/066print-int.subx @@ -5,6 +5,18 @@ # . 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 + # no error checking; accepts argument in EAX + # if (EAX <= 9) return EAX + '0' + 3d/compare-EAX-with 0x9/imm32/9 + 7f/jump-if-greater $to-hex-char:else/disp8 + 05/add-to-EAX 0x30/imm32/0 + c3/return +$to-hex-char:else: + # otherwise return EAX + 'a' - 10 + 05/add-to-EAX 0x57/imm32/a-10 + c3/return + append-byte-hex: # f : (address stream), n : int -> <void> # . prolog 55/push-EBP diff --git a/subx/065hex.subx b/subx/067parse-hex.subx index d188d4d3..bbfc4ec9 100644 --- a/subx/065hex.subx +++ b/subx/067parse-hex.subx @@ -1,4 +1,4 @@ -# some utilities for converting numbers to/from hex +# some utilities for converting numbers from hex # lowercase letters only for now == code @@ -806,16 +806,4 @@ $from-hex-char:else: 2d/subtract-from-EAX 0x57/imm32/a-10 c3/return -to-hex-char: # in/EAX : nibble -> out/EAX : byte - # no error checking; accepts argument in EAX - # if (EAX <= 9) return EAX + '0' - 3d/compare-EAX-with 0x9/imm32/9 - 7f/jump-if-greater $to-hex-char:else/disp8 - 05/add-to-EAX 0x30/imm32/0 - c3/return -$to-hex-char:else: - # otherwise return EAX + 'a' - 10 - 05/add-to-EAX 0x57/imm32/a-10 - c3/return - # . . vim:nowrap:textwidth=0 diff --git a/subx/apps/assort b/subx/apps/assort index 8a109450..d096be37 100755 --- a/subx/apps/assort +++ b/subx/apps/assort Binary files differdiff --git a/subx/apps/crenshaw2-1 b/subx/apps/crenshaw2-1 index e28504b5..db50d1cf 100755 --- a/subx/apps/crenshaw2-1 +++ b/subx/apps/crenshaw2-1 Binary files differdiff --git a/subx/apps/crenshaw2-1b b/subx/apps/crenshaw2-1b index 8db1600f..4e05331b 100755 --- a/subx/apps/crenshaw2-1b +++ b/subx/apps/crenshaw2-1b Binary files differdiff --git a/subx/apps/dquotes b/subx/apps/dquotes index 8567ba31..49ca7a1a 100755 --- a/subx/apps/dquotes +++ b/subx/apps/dquotes Binary files differdiff --git a/subx/apps/factorial b/subx/apps/factorial index cdf8e50f..820890e5 100755 --- a/subx/apps/factorial +++ b/subx/apps/factorial Binary files differdiff --git a/subx/apps/handle b/subx/apps/handle index a03f4c70..1ba82034 100755 --- a/subx/apps/handle +++ b/subx/apps/handle Binary files differdiff --git a/subx/apps/hex b/subx/apps/hex index 50c168a3..230e3f2d 100755 --- a/subx/apps/hex +++ b/subx/apps/hex Binary files differdiff --git a/subx/apps/pack b/subx/apps/pack index 5c2aba74..757378f9 100755 --- a/subx/apps/pack +++ b/subx/apps/pack Binary files differdiff --git a/subx/apps/survey b/subx/apps/survey index b48862c8..4d30e651 100755 --- a/subx/apps/survey +++ b/subx/apps/survey Binary files differdiff --git a/subx/apps/tests b/subx/apps/tests index 47d45649..58ece991 100755 --- a/subx/apps/tests +++ b/subx/apps/tests Binary files differ |