From de7713d97470528ee47031f64446d45555ee7a10 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sun, 7 Mar 2021 21:05:45 -0800 Subject: 7867 --- linux/118parse-hex-int.subx | 142 ++++++------ linux/126write-int-decimal.subx | 40 ++-- linux/128subx-words.subx | 102 ++++----- linux/130emit.subx | 6 +- linux/311decimal-int.subx | 4 +- linux/400.mu | 10 +- linux/advent2020/2a.mu | 6 +- linux/advent2020/2b.mu | 6 +- linux/advent2020/4b.mu | 2 +- linux/arith.mu | 10 +- linux/assort | Bin 46815 -> 46755 bytes linux/braces | Bin 48870 -> 48810 bytes linux/calls | Bin 53865 -> 53805 bytes linux/crenshaw2-1.subx | 16 +- linux/crenshaw2-1b.subx | 24 +- linux/dquotes | Bin 50437 -> 50377 bytes linux/dquotes.subx | 28 +-- linux/hex | Bin 48995 -> 48935 bytes linux/hex.subx | 8 +- linux/mu | Bin 602318 -> 602258 bytes linux/mu.subx | 470 ++++++++++++++++++++-------------------- linux/pack | Bin 59505 -> 59445 bytes linux/rpn.mu | 12 +- linux/sigils | Bin 61239 -> 61179 bytes linux/sigils.subx | 12 +- linux/survey_baremetal | Bin 51201 -> 51141 bytes linux/survey_baremetal.subx | 52 ++--- linux/survey_elf | Bin 56486 -> 56426 bytes linux/survey_elf.subx | 52 ++--- linux/tests | Bin 45606 -> 45546 bytes linux/tests.subx | 8 +- linux/tile/environment.mu | 4 +- linux/tile/grapheme-stack.mu | 2 +- linux/tile/rpn.mu | 88 ++++---- linux/tile/table.mu | 4 +- 35 files changed, 554 insertions(+), 554 deletions(-) (limited to 'linux') diff --git a/linux/118parse-hex-int.subx b/linux/118parse-hex-int.subx index 5d92b13a..ac911d97 100644 --- a/linux/118parse-hex-int.subx +++ b/linux/118parse-hex-int.subx @@ -6,7 +6,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 -is-hex-int?: # in: (addr slice) -> result/eax: boolean +hex-int?: # in: (addr slice) -> result/eax: boolean # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -23,58 +23,58 @@ is-hex-int?: # in: (addr slice) -> result/eax: boolean # if s is empty return false b8/copy-to-eax 0/imm32/false 39/compare 3/mod/direct 1/rm32/ecx . . . 2/r32/edx . . # compare ecx with edx - 73/jump-if-addr>= $is-hex-int?:end/disp8 + 73/jump-if-addr>= $hex-int?:end/disp8 # skip past leading '-' # . if (*curr == '-') ++curr 31/xor 3/mod/direct 3/rm32/ebx . . . 3/r32/ebx . . # clear ebx 8a/copy-byte 0/mod/indirect 1/rm32/ecx . . . 3/r32/BL . . # copy byte at *ecx to BL 81 7/subop/compare 3/mod/direct 3/rm32/ebx . . . . . 0x2d/imm32/- # compare ebx - 75/jump-if-!= $is-hex-int?:initial-0/disp8 + 75/jump-if-!= $hex-int?:initial-0/disp8 # . ++curr 41/increment-ecx # skip past leading '0x' -$is-hex-int?:initial-0: +$hex-int?:initial-0: # . if (*curr != '0') jump to loop 31/xor 3/mod/direct 3/rm32/ebx . . . 3/r32/ebx . . # clear ebx 8a/copy-byte 0/mod/indirect 1/rm32/ecx . . . 3/r32/BL . . # copy byte at *ecx to BL 81 7/subop/compare 3/mod/direct 3/rm32/ebx . . . . . 0x30/imm32/0 # compare ebx - 75/jump-if-!= $is-hex-int?:loop/disp8 + 75/jump-if-!= $hex-int?:loop/disp8 # . ++curr 41/increment-ecx -$is-hex-int?:initial-0x: +$hex-int?:initial-0x: # . if (curr >= in->end) return true 39/compare 3/mod/direct 1/rm32/ecx . . . 2/r32/edx . . # compare ecx with edx - 73/jump-if-addr>= $is-hex-int?:true/disp8 + 73/jump-if-addr>= $hex-int?:true/disp8 # . if (*curr != 'x') jump to loop # the previous '0' is still valid so doesn't need to be checked again 31/xor 3/mod/direct 3/rm32/ebx . . . 3/r32/ebx . . # clear ebx 8a/copy-byte 0/mod/indirect 1/rm32/ecx . . . 3/r32/BL . . # copy byte at *ecx to BL 81 7/subop/compare 3/mod/direct 3/rm32/ebx . . . . . 0x78/imm32/x # compare ebx - 75/jump-if-!= $is-hex-int?:loop/disp8 + 75/jump-if-!= $hex-int?:loop/disp8 # . ++curr 41/increment-ecx -$is-hex-int?:loop: +$hex-int?:loop: # if (curr >= in->end) return true 39/compare 3/mod/direct 1/rm32/ecx . . . 2/r32/edx . . # compare ecx with edx - 73/jump-if-addr>= $is-hex-int?:true/disp8 - # var eax: boolean = is-hex-digit?(*curr) + 73/jump-if-addr>= $hex-int?:true/disp8 + # var eax: boolean = hex-digit?(*curr) # . . push args 8a/copy-byte 0/mod/indirect 1/rm32/ecx . . . 0/r32/AL . . # copy byte at *ecx to AL 50/push-eax # . . call - e8/call is-hex-digit?/disp32 + e8/call hex-digit?/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp # if (eax == false) return false 3d/compare-eax-and 0/imm32/false - 74/jump-if-= $is-hex-int?:end/disp8 + 74/jump-if-= $hex-int?:end/disp8 # ++curr 41/increment-ecx # loop - eb/jump $is-hex-int?:loop/disp8 -$is-hex-int?:true: + eb/jump $hex-int?:loop/disp8 +$hex-int?:true: # return true b8/copy-to-eax 1/imm32/true -$is-hex-int?:end: +$hex-int?:end: # . restore registers 5b/pop-to-ebx 5a/pop-to-edx @@ -84,7 +84,7 @@ $is-hex-int?:end: 5d/pop-to-ebp c3/return -test-is-hex-int: +test-hex-int: # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -97,16 +97,16 @@ test-is-hex-int: 51/push-ecx 50/push-eax 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx - # eax = is-hex-int?(slice) + # eax = hex-int?(slice) # . . push args 51/push-ecx # . . call - e8/call is-hex-int?/disp32 + e8/call hex-int?/disp32 # . . 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 - 68/push "F - test-is-hex-int"/imm32 + 68/push "F - test-hex-int"/imm32 68/push 1/imm32/true 50/push-eax # . . call @@ -118,7 +118,7 @@ test-is-hex-int: 5d/pop-to-ebp c3/return -test-is-hex-int-handles-letters: +test-hex-int-handles-letters: # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -131,16 +131,16 @@ test-is-hex-int-handles-letters: 51/push-ecx 50/push-eax 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx - # eax = is-hex-int?(slice) + # eax = hex-int?(slice) # . . push args 51/push-ecx # . . call - e8/call is-hex-int?/disp32 + e8/call hex-int?/disp32 # . . 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 - 68/push "F - test-is-hex-int-handles-letters"/imm32 + 68/push "F - test-hex-int-handles-letters"/imm32 68/push 1/imm32/true 50/push-eax # . . call @@ -152,7 +152,7 @@ test-is-hex-int-handles-letters: 5d/pop-to-ebp c3/return -test-is-hex-int-with-trailing-char: +test-hex-int-with-trailing-char: # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -165,16 +165,16 @@ test-is-hex-int-with-trailing-char: 51/push-ecx 50/push-eax 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx - # eax = is-hex-int?(slice) + # eax = hex-int?(slice) # . . push args 51/push-ecx # . . call - e8/call is-hex-int?/disp32 + e8/call hex-int?/disp32 # . . 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 - 68/push "F - test-is-hex-int-with-trailing-char"/imm32 + 68/push "F - test-hex-int-with-trailing-char"/imm32 68/push 0/imm32/false 50/push-eax # . . call @@ -186,7 +186,7 @@ test-is-hex-int-with-trailing-char: 5d/pop-to-ebp c3/return -test-is-hex-int-with-leading-char: +test-hex-int-with-leading-char: # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -199,16 +199,16 @@ test-is-hex-int-with-leading-char: 51/push-ecx 50/push-eax 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx - # eax = is-hex-int?(slice) + # eax = hex-int?(slice) # . . push args 51/push-ecx # . . call - e8/call is-hex-int?/disp32 + e8/call hex-int?/disp32 # . . 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 - 68/push "F - test-is-hex-int-with-leading-char"/imm32 + 68/push "F - test-hex-int-with-leading-char"/imm32 68/push 0/imm32/false 50/push-eax # . . call @@ -220,7 +220,7 @@ test-is-hex-int-with-leading-char: 5d/pop-to-ebp c3/return -test-is-hex-int-empty: +test-hex-int-empty: # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -228,16 +228,16 @@ test-is-hex-int-empty: 68/push 0/imm32 68/push 0/imm32 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx - # eax = is-hex-int?(slice) + # eax = hex-int?(slice) # . . push args 51/push-ecx # . . call - e8/call is-hex-int?/disp32 + e8/call hex-int?/disp32 # . . 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 - 68/push "F - test-is-hex-int-empty"/imm32 + 68/push "F - test-hex-int-empty"/imm32 68/push 0/imm32/false 50/push-eax # . . call @@ -249,7 +249,7 @@ test-is-hex-int-empty: 5d/pop-to-ebp c3/return -test-is-hex-int-handles-0x-prefix: +test-hex-int-handles-0x-prefix: # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -262,16 +262,16 @@ test-is-hex-int-handles-0x-prefix: 51/push-ecx 50/push-eax 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx - # eax = is-hex-int?(slice) + # eax = hex-int?(slice) # . . push args 51/push-ecx # . . call - e8/call is-hex-int?/disp32 + e8/call hex-int?/disp32 # . . 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 - 68/push "F - test-is-hex-int-handles-0x-prefix"/imm32 + 68/push "F - test-hex-int-handles-0x-prefix"/imm32 68/push 1/imm32/true 50/push-eax # . . call @@ -283,7 +283,7 @@ test-is-hex-int-handles-0x-prefix: 5d/pop-to-ebp c3/return -test-is-hex-int-handles-negative: +test-hex-int-handles-negative: # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -296,16 +296,16 @@ test-is-hex-int-handles-negative: 51/push-ecx 50/push-eax 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx - # eax = is-hex-int?(slice) + # eax = hex-int?(slice) # . . push args 51/push-ecx # . . call - e8/call is-hex-int?/disp32 + e8/call hex-int?/disp32 # . . 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 - 68/push "F - test-is-hex-int-handles-negative"/imm32 + 68/push "F - test-hex-int-handles-negative"/imm32 68/push 1/imm32/true 50/push-eax # . . call @@ -317,7 +317,7 @@ test-is-hex-int-handles-negative: 5d/pop-to-ebp c3/return -test-is-hex-int-handles-negative-0x-prefix: +test-hex-int-handles-negative-0x-prefix: # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -330,16 +330,16 @@ test-is-hex-int-handles-negative-0x-prefix: 51/push-ecx 50/push-eax 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx - # eax = is-hex-int?(slice) + # eax = hex-int?(slice) # . . push args 51/push-ecx # . . call - e8/call is-hex-int?/disp32 + e8/call hex-int?/disp32 # . . 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 - 68/push "F - test-is-hex-int-handles-negative-0x-prefix"/imm32 + 68/push "F - test-hex-int-handles-negative-0x-prefix"/imm32 68/push 1/imm32/true 50/push-eax # . . call @@ -698,7 +698,7 @@ test-parse-hex-int-from-slice-negative: 5d/pop-to-ebp c3/return -is-hex-digit?: # c: byte -> result/eax: boolean +hex-digit?: # c: byte -> result/eax: boolean # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -708,25 +708,25 @@ is-hex-digit?: # c: byte -> result/eax: boolean 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 1/r32/ecx 8/disp8 . # copy *(ebp+8) to ecx # return false if c < '0' 81 7/subop/compare 3/mod/direct 1/rm32/ecx . . . . . 0x30/imm32 # compare ecx - 7c/jump-if-< $is-hex-digit?:false/disp8 + 7c/jump-if-< $hex-digit?:false/disp8 # return true if c <= '9' 81 7/subop/compare 3/mod/direct 1/rm32/ecx . . . . . 0x39/imm32 # compare ecx - 7e/jump-if-<= $is-hex-digit?:true/disp8 + 7e/jump-if-<= $hex-digit?:true/disp8 # drop case 25/and-eax-with 0x5f/imm32 # return false if c > 'f' 81 7/subop/compare 3/mod/direct 1/rm32/ecx . . . . . 0x66/imm32 # compare ecx - 7f/jump-if-> $is-hex-digit?:false/disp8 + 7f/jump-if-> $hex-digit?:false/disp8 # return true if c >= 'a' 81 7/subop/compare 3/mod/direct 1/rm32/ecx . . . . . 0x61/imm32 # compare ecx - 7d/jump-if->= $is-hex-digit?:true/disp8 + 7d/jump-if->= $hex-digit?:true/disp8 # otherwise return false -$is-hex-digit?:false: +$hex-digit?:false: b8/copy-to-eax 0/imm32/false - eb/jump $is-hex-digit?:end/disp8 -$is-hex-digit?:true: + eb/jump $hex-digit?:end/disp8 +$hex-digit?:true: b8/copy-to-eax 1/imm32/true -$is-hex-digit?:end: +$hex-digit?:end: # . restore registers 59/pop-to-ecx # . epilogue @@ -735,11 +735,11 @@ $is-hex-digit?:end: c3/return test-hex-below-0: - # eax = is-hex-digit?(0x2f) + # eax = hex-digit?(0x2f) # . . push args 68/push 0x2f/imm32 # . . call - e8/call is-hex-digit?/disp32 + e8/call hex-digit?/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp # check-ints-equal(eax, 0, msg) @@ -754,11 +754,11 @@ test-hex-below-0: c3/return test-hex-0-to-9: - # eax = is-hex-digit?(0x30) + # eax = hex-digit?(0x30) # . . push args 68/push 0x30/imm32 # . . call - e8/call is-hex-digit?/disp32 + e8/call hex-digit?/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp # check-ints-equal(eax, 1, msg) @@ -770,11 +770,11 @@ test-hex-0-to-9: e8/call check-ints-equal/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp - # eax = is-hex-digit?(0x39) + # eax = hex-digit?(0x39) # . . push args 68/push 0x39/imm32 # . . call - e8/call is-hex-digit?/disp32 + e8/call hex-digit?/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp # check-ints-equal(eax, 1, msg) @@ -789,11 +789,11 @@ test-hex-0-to-9: c3/return test-hex-above-9-to-a: - # eax = is-hex-digit?(0x3a) + # eax = hex-digit?(0x3a) # . . push args 68/push 0x3a/imm32 # . . call - e8/call is-hex-digit?/disp32 + e8/call hex-digit?/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp # check-ints-equal(eax, 0, msg) @@ -808,11 +808,11 @@ test-hex-above-9-to-a: c3/return test-hex-a-to-f: - # eax = is-hex-digit?(0x61) + # eax = hex-digit?(0x61) # . . push args 68/push 0x61/imm32 # . . call - e8/call is-hex-digit?/disp32 + e8/call hex-digit?/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp # check-ints-equal(eax, 1, msg) @@ -824,11 +824,11 @@ test-hex-a-to-f: e8/call check-ints-equal/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp - # eax = is-hex-digit?(0x66) + # eax = hex-digit?(0x66) # . . push args 68/push 0x66/imm32 # . . call - e8/call is-hex-digit?/disp32 + e8/call hex-digit?/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp # check-ints-equal(eax, 1, msg) @@ -843,11 +843,11 @@ test-hex-a-to-f: c3/return test-hex-above-f: - # eax = is-hex-digit?(0x67) + # eax = hex-digit?(0x67) # . . push args 68/push 0x67/imm32 # . . call - e8/call is-hex-digit?/disp32 + e8/call hex-digit?/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp # check-ints-equal(eax, 0, msg) diff --git a/linux/126write-int-decimal.subx b/linux/126write-int-decimal.subx index 678d8eec..bff585a7 100644 --- a/linux/126write-int-decimal.subx +++ b/linux/126write-int-decimal.subx @@ -303,7 +303,7 @@ test-write-int32-decimal-negative-multiple-digits: # . end c3/return -is-decimal-digit?: # c: grapheme -> result/eax: boolean +decimal-digit?: # c: grapheme -> result/eax: boolean # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -315,13 +315,13 @@ is-decimal-digit?: # c: grapheme -> result/eax: boolean b8/copy-to-eax 0/imm32/false # return false if c < '0' 81 7/subop/compare 3/mod/direct 1/rm32/ecx . . . . . 0x30/imm32 # compare ecx - 7c/jump-if-< $is-decimal-digit?:end/disp8 + 7c/jump-if-< $decimal-digit?:end/disp8 # return (c <= '9') 81 7/subop/compare 3/mod/direct 1/rm32/ecx . . . . . 0x39/imm32 # compare ecx - 7f/jump-if-> $is-decimal-digit?:end/disp8 -$is-decimal-digit?:true: + 7f/jump-if-> $decimal-digit?:end/disp8 +$decimal-digit?:true: b8/copy-to-eax 1/imm32/true -$is-decimal-digit?:end: +$decimal-digit?:end: # . restore registers 59/pop-to-ecx # . epilogue @@ -329,17 +329,17 @@ $is-decimal-digit?:end: 5d/pop-to-ebp c3/return -test-is-decimal-digit-below-0: - # eax = is-decimal-digit?(0x2f) +test-decimal-digit-below-0: + # eax = decimal-digit?(0x2f) # . . push args 68/push 0x2f/imm32 # . . call - e8/call is-decimal-digit?/disp32 + e8/call decimal-digit?/disp32 # . . 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 - 68/push "F - test-is-decimal-digit-below-0"/imm32 + 68/push "F - test-decimal-digit-below-0"/imm32 68/push 0/imm32/false 50/push-eax # . . call @@ -348,33 +348,33 @@ test-is-decimal-digit-below-0: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp c3/return -test-is-decimal-digit-0-to-9: - # eax = is-decimal-digit?(0x30) +test-decimal-digit-0-to-9: + # eax = decimal-digit?(0x30) # . . push args 68/push 0x30/imm32 # . . call - e8/call is-decimal-digit?/disp32 + e8/call decimal-digit?/disp32 # . . 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 - 68/push "F - test-is-decimal-digit-at-0"/imm32 + 68/push "F - test-decimal-digit-at-0"/imm32 68/push 1/imm32/true 50/push-eax # . . call e8/call check-ints-equal/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp - # eax = is-decimal-digit?(0x39) + # eax = decimal-digit?(0x39) # . . push args 68/push 0x39/imm32 # . . call - e8/call is-decimal-digit?/disp32 + e8/call decimal-digit?/disp32 # . . 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 - 68/push "F - test-is-decimal-digit-at-9"/imm32 + 68/push "F - test-decimal-digit-at-9"/imm32 68/push 1/imm32/true 50/push-eax # . . call @@ -383,17 +383,17 @@ test-is-decimal-digit-0-to-9: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp c3/return -test-is-decimal-digit-above-9: - # eax = is-decimal-digit?(0x3a) +test-decimal-digit-above-9: + # eax = decimal-digit?(0x3a) # . . push args 68/push 0x3a/imm32 # . . call - e8/call is-decimal-digit?/disp32 + e8/call decimal-digit?/disp32 # . . 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 - 68/push "F - test-is-decimal-digit-above-9"/imm32 + 68/push "F - test-decimal-digit-above-9"/imm32 68/push 0/imm32/false 50/push-eax # . . call diff --git a/linux/128subx-words.subx b/linux/128subx-words.subx index c3da70f0..5cc8db83 100644 --- a/linux/128subx-words.subx +++ b/linux/128subx-words.subx @@ -275,7 +275,7 @@ test-has-metadata-multiple-false: #: - if it starts with '0x' it's treated as a number. (redundant) #: - if it's two characters long, it can't be a name. Either it's a hex #: byte, or it raises an error. -is-valid-name?: # in: (addr slice) -> result/eax: boolean +valid-name?: # in: (addr slice) -> result/eax: boolean # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -286,40 +286,40 @@ is-valid-name?: # in: (addr slice) -> result/eax: boolean 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 6/r32/esi 8/disp8 . # copy *(ebp+8) to esi # var start/ecx: (addr byte) = in->start 8b/copy 0/mod/indirect 6/rm32/esi . . . 1/r32/ecx . . # copy *esi to ecx -$is-valid-name?:check0: +$valid-name?:check0: # if (start >= in->end) return false 3b/compare 1/mod/*+disp8 6/rm32/esi . . . 1/r32/ecx 4/disp8 . # compare ecx with *(esi+4) - 73/jump-if-addr>= $is-valid-name?:false/disp8 -$is-valid-name?:check1: + 73/jump-if-addr>= $valid-name?:false/disp8 +$valid-name?:check1: # var len/eax: int = in->end - start 8b/copy 1/mod/*+disp8 6/rm32/esi . . . 0/r32/eax 4/disp8 . # copy *(esi+4) to eax 29/subtract 3/mod/direct 0/rm32/eax . . . 1/r32/ecx . . # subtract ecx from eax # if (eax == 2) return false 3d/compare-eax-and 2/imm32 - 74/jump-if-= $is-valid-name?:false/disp8 -$is-valid-name?:check2: + 74/jump-if-= $valid-name?:false/disp8 +$valid-name?:check2: # var c/eax: (addr byte) = *start 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . . # clear eax 8a/copy-byte 0/mod/indirect 1/rm32/ecx . . . 0/r32/AL . . # copy byte at *ecx to AL # if (c == "-") return false 3d/compare-eax-and 2d/imm32/- - 74/jump-if-= $is-valid-name?:false/disp8 -$is-valid-name?:check3a: + 74/jump-if-= $valid-name?:false/disp8 +$valid-name?:check3a: # if (c < "0") return true 3d/compare-eax-with 30/imm32/0 - 7c/jump-if-< $is-valid-name?:true/disp8 -$is-valid-name?:check3b: + 7c/jump-if-< $valid-name?:true/disp8 +$valid-name?:check3b: # if (c > "9") return true 3d/compare-eax-with 39/imm32/9 - 7f/jump-if-> $is-valid-name?:true/disp8 -$is-valid-name?:false: + 7f/jump-if-> $valid-name?:true/disp8 +$valid-name?:false: # return false b8/copy-to-eax 0/imm32/false - eb/jump $is-valid-name?:end/disp8 -$is-valid-name?:true: + eb/jump $valid-name?:end/disp8 +$valid-name?:true: # return true b8/copy-to-eax 1/imm32/true -$is-valid-name?:end: +$valid-name?:end: # . restore registers 5e/pop-to-esi 59/pop-to-ecx @@ -328,7 +328,7 @@ $is-valid-name?:end: 5d/pop-to-ebp c3/return -test-is-valid-name-digit-prefix: +test-valid-name-digit-prefix: # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -341,16 +341,16 @@ test-is-valid-name-digit-prefix: 51/push-ecx 50/push-eax 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx - # eax = is-valid-name?(slice) + # eax = valid-name?(slice) # . . push args 51/push-ecx # . . call - e8/call is-valid-name?/disp32 + e8/call valid-name?/disp32 # . . 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 - 68/push "F - test-is-valid-name-digit-prefix"/imm32 + 68/push "F - test-valid-name-digit-prefix"/imm32 68/push 0/imm32/false 50/push-eax # . . call @@ -362,7 +362,7 @@ test-is-valid-name-digit-prefix: 5d/pop-to-ebp c3/return -test-is-valid-name-negative-prefix: +test-valid-name-negative-prefix: # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -375,16 +375,16 @@ test-is-valid-name-negative-prefix: 51/push-ecx 50/push-eax 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx - # eax = is-valid-name?(slice) + # eax = valid-name?(slice) # . . push args 51/push-ecx # . . call - e8/call is-valid-name?/disp32 + e8/call valid-name?/disp32 # . . 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 - 68/push "F - test-is-valid-name-negative-prefix"/imm32 + 68/push "F - test-valid-name-negative-prefix"/imm32 68/push 0/imm32/false 50/push-eax # . . call @@ -396,7 +396,7 @@ test-is-valid-name-negative-prefix: 5d/pop-to-ebp c3/return -test-is-valid-name-0x-prefix: +test-valid-name-0x-prefix: # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -409,16 +409,16 @@ test-is-valid-name-0x-prefix: 51/push-ecx 50/push-eax 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx - # eax = is-valid-name?(slice) + # eax = valid-name?(slice) # . . push args 51/push-ecx # . . call - e8/call is-valid-name?/disp32 + e8/call valid-name?/disp32 # . . 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 - 68/push "F - test-is-valid-name-0x-prefix"/imm32 + 68/push "F - test-valid-name-0x-prefix"/imm32 68/push 0/imm32/false 50/push-eax # . . call @@ -430,7 +430,7 @@ test-is-valid-name-0x-prefix: 5d/pop-to-ebp c3/return -test-is-valid-name-starts-with-pre-digit: +test-valid-name-starts-with-pre-digit: # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -443,16 +443,16 @@ test-is-valid-name-starts-with-pre-digit: 51/push-ecx 50/push-eax 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx - # eax = is-valid-name?(slice) + # eax = valid-name?(slice) # . . push args 51/push-ecx # . . call - e8/call is-valid-name?/disp32 + e8/call valid-name?/disp32 # . . 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 - 68/push "F - test-is-valid-name-starts-with-pre-digit"/imm32 + 68/push "F - test-valid-name-starts-with-pre-digit"/imm32 68/push 1/imm32/true 50/push-eax # . . call @@ -464,7 +464,7 @@ test-is-valid-name-starts-with-pre-digit: 5d/pop-to-ebp c3/return -test-is-valid-name-starts-with-post-digit: +test-valid-name-starts-with-post-digit: # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -477,16 +477,16 @@ test-is-valid-name-starts-with-post-digit: 51/push-ecx 50/push-eax 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx - # eax = is-valid-name?(slice) + # eax = valid-name?(slice) # . . push args 51/push-ecx # . . call - e8/call is-valid-name?/disp32 + e8/call valid-name?/disp32 # . . 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 - 68/push "F - test-is-valid-name-starts-with-post-digit"/imm32 + 68/push "F - test-valid-name-starts-with-post-digit"/imm32 68/push 1/imm32/true 50/push-eax # . . call @@ -498,7 +498,7 @@ test-is-valid-name-starts-with-post-digit: 5d/pop-to-ebp c3/return -test-is-valid-name-starts-with-digit: +test-valid-name-starts-with-digit: # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -511,16 +511,16 @@ test-is-valid-name-starts-with-digit: 51/push-ecx 50/push-eax 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx - # eax = is-valid-name?(slice) + # eax = valid-name?(slice) # . . push args 51/push-ecx # . . call - e8/call is-valid-name?/disp32 + e8/call valid-name?/disp32 # . . 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 - 68/push "F - test-is-valid-name-starts-with-digit"/imm32 + 68/push "F - test-valid-name-starts-with-digit"/imm32 68/push 0/imm32/false 50/push-eax # . . call @@ -532,7 +532,7 @@ test-is-valid-name-starts-with-digit: 5d/pop-to-ebp c3/return -is-label?: # word: (addr slice) -> result/eax: boolean +label?: # word: (addr slice) -> result/eax: boolean # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -549,9 +549,9 @@ is-label?: # word: (addr slice) -> result/eax: boolean # . return (eax == ':') 3d/compare-eax-and 0x3a/imm32/colon b8/copy-to-eax 1/imm32/true - 74/jump-if-= $is-label?:end/disp8 + 74/jump-if-= $label?:end/disp8 b8/copy-to-eax 0/imm32/false -$is-label?:end: +$label?:end: # . restore registers 59/pop-to-ecx # . epilogue @@ -559,11 +559,11 @@ $is-label?:end: 5d/pop-to-ebp c3/return -test-is-label?: +test-label?: # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp -$test-is-label?:true: +$test-label?:true: # (eax..ecx) = "AAA:" b8/copy-to-eax "AAA:"/imm32 8b/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . . # copy *eax to ecx @@ -573,23 +573,23 @@ $test-is-label?:true: 51/push-ecx 50/push-eax 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx - # is-label?(slice/ecx) + # label?(slice/ecx) # . . push args 51/push-ecx # . . call - e8/call is-label?/disp32 + e8/call label?/disp32 # . . 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 - 68/push "F - test-is-label?:true"/imm32 + 68/push "F - test-label?:true"/imm32 68/push 1/imm32 50/push-eax # . . call e8/call check-ints-equal/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp -$test-is-label?:false: +$test-label?:false: # (eax..ecx) = "AAA" b8/copy-to-eax "AAA"/imm32 8b/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . . # copy *eax to ecx @@ -599,16 +599,16 @@ $test-is-label?:false: 51/push-ecx 50/push-eax 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx - # is-label?(slice/ecx) + # label?(slice/ecx) # . . push args 51/push-ecx # . . call - e8/call is-label?/disp32 + e8/call label?/disp32 # . . 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 - 68/push "F - test-is-label?:false"/imm32 + 68/push "F - test-label?:false"/imm32 68/push 0/imm32 50/push-eax # . . call diff --git a/linux/130emit.subx b/linux/130emit.subx index 154b1bea..40b98be6 100644 --- a/linux/130emit.subx +++ b/linux/130emit.subx @@ -31,12 +31,12 @@ emit: # out: (addr buffered-file), word: (addr slice), width: int e8/call next-token-from-slice/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32 # add to esp - # if (is-valid-name?(datum)) write-slice-buffered(out, word) and return - # . eax = is-valid-name?(name) + # if (valid-name?(datum)) write-slice-buffered(out, word) and return + # . eax = valid-name?(name) # . . push args 57/push-edi # . . call - e8/call is-valid-name?/disp32 + e8/call valid-name?/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp # . if (eax != false) diff --git a/linux/311decimal-int.subx b/linux/311decimal-int.subx index badae601..80b60c26 100644 --- a/linux/311decimal-int.subx +++ b/linux/311decimal-int.subx @@ -124,10 +124,10 @@ $parse-decimal-int-helper:loop: # if (curr >= in->end) break 39/compare %esi 7/r32/edi 73/jump-if-addr>= break/disp8 - # if !is-decimal-digit?(*curr) return 0 + # if !decimal-digit?(*curr) return 0 8a/copy-byte *esi 1/r32/CL 50/push-eax - (is-decimal-digit? %ecx) # => eax + (decimal-digit? %ecx) # => eax { 3d/compare-eax-and 0/imm32/false 75/jump-if-!= break/disp8 diff --git a/linux/400.mu b/linux/400.mu index d766a8f6..c757c970 100644 --- a/linux/400.mu +++ b/linux/400.mu @@ -65,11 +65,11 @@ sig write-int32-hex f: (addr stream byte), n: int sig write-int32-hex-bits f: (addr stream byte), n: int, bits: int sig write-int32-hex-buffered f: (addr buffered-file), n: int sig write-int32-hex-bits-buffered f: (addr buffered-file), n: int, bits: int -sig is-hex-int? in: (addr slice) -> _/eax: boolean +sig hex-int? in: (addr slice) -> _/eax: boolean sig parse-hex-int in: (addr array byte) -> _/eax: int sig parse-hex-int-from-slice in: (addr slice) -> _/eax: int #sig parse-hex-int-helper start: (addr byte), end: (addr byte) -> _/eax: int -sig is-hex-digit? c: byte -> _/eax: boolean +sig hex-digit? c: byte -> _/eax: boolean #sig from-hex-char in/eax: byte -> out/eax: nibble sig parse-decimal-int in: (addr array byte) -> _/eax: int sig parse-decimal-int-from-slice in: (addr slice) -> _/eax: int @@ -113,7 +113,7 @@ sig skip-until-close-paren line: (addr stream byte) #sig skip-until-close-paren-in-slice curr: (addr byte), end: (addr byte) -> _/eax: (addr byte) sig write-stream-data f: (addr buffered-file), s: (addr stream byte) sig write-int32-decimal out: (addr stream byte), n: int -sig is-decimal-digit? c: grapheme -> _/eax: boolean +sig decimal-digit? c: grapheme -> _/eax: boolean sig to-decimal-digit in: grapheme -> _/eax: int # bad name alert # next-word really tokenizes @@ -121,8 +121,8 @@ sig to-decimal-digit in: grapheme -> _/eax: int sig next-word line: (addr stream byte), out: (addr slice) # skips '#' comments sig next-raw-word line: (addr stream byte), out: (addr slice) # does not skip '#' comments sig has-metadata? word: (addr slice), s: (addr string) -> _/eax: boolean -sig is-valid-name? in: (addr slice) -> _/eax: boolean -sig is-label? word: (addr slice) -> _/eax: boolean +sig valid-name? in: (addr slice) -> _/eax: boolean +sig label? word: (addr slice) -> _/eax: boolean sig emit-hex out: (addr buffered-file), n: int, width: int sig emit out: (addr buffered-file), word: (addr slice), width: int #sig get table: (addr stream {(handle array byte), T}), key: (addr array byte), row-size: int, abort-message-prefix: (addr array byte) -> _/eax: (addr T) diff --git a/linux/advent2020/2a.mu b/linux/advent2020/2a.mu index 4492e7ea..ce678eb8 100644 --- a/linux/advent2020/2a.mu +++ b/linux/advent2020/2a.mu @@ -46,8 +46,8 @@ fn main -> _/ebx: int { } skip-chars-matching-whitespace line # now check the rest of the line - var is-valid?/eax: boolean <- is-valid? start, end, letter, line - compare is-valid?, 0/false + var valid?/eax: boolean <- valid? start, end, letter, line + compare valid?, 0/false { break-if-= print-string 0, "valid!\n" @@ -60,7 +60,7 @@ fn main -> _/ebx: int { return 0 } -fn is-valid? start: int, end: int, letter: byte, password: (addr stream byte) -> _/eax: boolean { +fn valid? start: int, end: int, letter: byte, password: (addr stream byte) -> _/eax: boolean { var letter-count/edi: int <- copy 0 # for every c in password # if (c == letter) diff --git a/linux/advent2020/2b.mu b/linux/advent2020/2b.mu index f228b451..121e9dfa 100644 --- a/linux/advent2020/2b.mu +++ b/linux/advent2020/2b.mu @@ -52,8 +52,8 @@ fn main -> _/ebx: int { } skip-chars-matching-whitespace line # now check the rest of the line - var is-valid?/eax: boolean <- is-valid? pos1, pos2, letter, line - compare is-valid?, 0/false + var valid?/eax: boolean <- valid? pos1, pos2, letter, line + compare valid?, 0/false { break-if-= print-string 0, "valid!\n" @@ -69,7 +69,7 @@ fn main -> _/ebx: int { # ideally password would be a random-access array # we'll just track an index # one benefit: we can easily start at 1 -fn is-valid? pos1: int, pos2: int, letter: byte, password: (addr stream byte) -> _/eax: boolean { +fn valid? pos1: int, pos2: int, letter: byte, password: (addr stream byte) -> _/eax: boolean { var i/esi: int <- copy 1 var letter-count/edi: int <- copy 0 # while password stream isn't empty diff --git a/linux/advent2020/4b.mu b/linux/advent2020/4b.mu index 00e99eeb..2dc6c6a2 100644 --- a/linux/advent2020/4b.mu +++ b/linux/advent2020/4b.mu @@ -231,7 +231,7 @@ fn main -> _/ebx: int { var c/eax: (addr byte) <- index s3, i { var c2/eax: byte <- copy-byte *c - var valid?/eax: boolean <- is-hex-digit? c2 + var valid?/eax: boolean <- hex-digit? c2 compare valid?, 0 loop-if-= $main:word-loop } diff --git a/linux/arith.mu b/linux/arith.mu index 0608d476..5a9d5032 100644 --- a/linux/arith.mu +++ b/linux/arith.mu @@ -73,7 +73,7 @@ fn expression _look: grapheme -> _/eax: int, _/esi: grapheme { # while next non-space char in ['+', '-'] look <- skip-spaces look { - var continue?/eax: boolean <- is-add-or-sub? look + var continue?/eax: boolean <- add-or-sub? look compare continue?, 0/false break-if-= $expression:loop } @@ -119,7 +119,7 @@ fn term _look: grapheme -> _/eax: int, _/esi: grapheme { # while next non-space char in ['*', '/'] look <- skip-spaces look { - var continue?/eax: boolean <- is-mul-or-div? look + var continue?/eax: boolean <- mul-or-div? look compare continue?, 0/false break-if-= $term:loop } @@ -174,7 +174,7 @@ fn factor _look: grapheme -> _/eax: int, _/esi: grapheme { return result, look } -fn is-mul-or-div? c: grapheme -> _/eax: boolean { +fn mul-or-div? c: grapheme -> _/eax: boolean { compare c, 0x2a/* { break-if-!= @@ -188,7 +188,7 @@ fn is-mul-or-div? c: grapheme -> _/eax: boolean { return 0/false } -fn is-add-or-sub? c: grapheme -> _/eax: boolean { +fn add-or-sub? c: grapheme -> _/eax: boolean { compare c, 0x2b/+ { break-if-!= @@ -218,7 +218,7 @@ fn num _look: grapheme -> _/eax: int, _/esi: grapheme { { look <- get-char # done? - var digit?/eax: boolean <- is-decimal-digit? look + var digit?/eax: boolean <- decimal-digit? look compare digit?, 0/false break-if-= # result *= 10 diff --git a/linux/assort b/linux/assort index f3ef87a2..9841efba 100755 Binary files a/linux/assort and b/linux/assort differ diff --git a/linux/braces b/linux/braces index 934cf0e9..8d030dfc 100755 Binary files a/linux/braces and b/linux/braces differ diff --git a/linux/calls b/linux/calls index 3279d1a8..344f8355 100755 Binary files a/linux/calls and b/linux/calls differ diff --git a/linux/crenshaw2-1.subx b/linux/crenshaw2-1.subx index 5b70e53f..41e3ad4e 100644 --- a/linux/crenshaw2-1.subx +++ b/linux/crenshaw2-1.subx @@ -186,7 +186,7 @@ $compile:end: # 'in' (rest). We leave the next byte from 'in' into 'Look' on exit. get-num: # in: (addr buffered-file), out: (addr stream byte), err: fd or (addr stream byte), ed: (addr exit-descriptor) # pseudocode: - # if (!is-digit?(Look)) expected(ed, err, "integer") + # if (!digit?(Look)) expected(ed, err, "integer") # if out->write >= out->size # write(err, "Error: too many digits in number\n") # stop(ed, 1) @@ -207,12 +207,12 @@ get-num: # in: (addr buffered-file), out: (addr stream byte), err: fd or (addr # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp - # - if (is-digit?(Look)) expected(ed, err, "integer") - # . eax = is-digit?(Look) + # - if (digit?(Look)) expected(ed, err, "integer") + # . eax = digit?(Look) # . . push args ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Look/disp32 . # push *Look # . . call - e8/call is-digit?/disp32 + e8/call digit?/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp # . if (eax == false) @@ -528,7 +528,7 @@ $get-char:end: 5d/pop-to-ebp c3/return -is-digit?: # c: int -> eax: boolean +digit?: # c: int -> eax: boolean # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -536,13 +536,13 @@ is-digit?: # c: int -> eax: boolean b8/copy-to-eax 0/imm32 # if (c < '0') return false 81 7/subop/compare 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 0x30/imm32 # compare *(ebp+8) - 7c/jump-if-< $is-digit?:end/disp8 + 7c/jump-if-< $digit?:end/disp8 # if (c > '9') return false 81 7/subop/compare 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 0x39/imm32 # compare *(ebp+8) - 7f/jump-if-> $is-digit?:end/disp8 + 7f/jump-if-> $digit?:end/disp8 # otherwise return true b8/copy-to-eax 1/imm32 -$is-digit?:end: +$digit?:end: # . epilogue 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . . # copy ebp to esp 5d/pop-to-ebp diff --git a/linux/crenshaw2-1b.subx b/linux/crenshaw2-1b.subx index fb8fd3b4..6915bd01 100644 --- a/linux/crenshaw2-1b.subx +++ b/linux/crenshaw2-1b.subx @@ -186,7 +186,7 @@ $compile:end: # 'in' (rest). We leave the next byte from 'in' into 'Look' on exit. get-num: # in: (addr buffered-file), out: (addr stream byte), err: fd or (addr stream byte), ed: (addr exit-descriptor) # pseudocode: - # if (!is-digit?(Look)) expected(ed, err, "integer") + # if (!digit?(Look)) expected(ed, err, "integer") # do # if out->write >= out->size # write(err, "Error: too many digits in number\n") @@ -194,7 +194,7 @@ get-num: # in: (addr buffered-file), out: (addr stream byte), err: fd or (addr # out->data[out->write] = LSB(Look) # ++out->write # Look = get-char(in) - # while is-digit?(Look) + # while digit?(Look) # This is complicated because I don't want to hard-code the error strategy in # a general helper like write-byte-buffered. Maybe I should just create a # local helper. @@ -212,12 +212,12 @@ get-num: # in: (addr buffered-file), out: (addr stream byte), err: fd or (addr # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp - # - if (is-digit?(Look)) expected(ed, err, "integer") - # . eax = is-digit?(Look) + # - if (digit?(Look)) expected(ed, err, "integer") + # . eax = digit?(Look) # . . push args ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Look/disp32 . # push *Look # . . call - e8/call is-digit?/disp32 + e8/call digit?/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp # . if (eax == false) @@ -277,12 +277,12 @@ $get-num:loop-stage2: e8/call get-char/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp - # if (is-digit?(Look)) loop - # . eax = is-digit?(Look) + # if (digit?(Look)) loop + # . eax = digit?(Look) # . . push args ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Look/disp32 . # push *Look # . . call - e8/call is-digit?/disp32 + e8/call digit?/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp # . if (eax != false) loop @@ -722,7 +722,7 @@ $get-char:end: 5d/pop-to-ebp c3/return -is-digit?: # c: int -> eax: boolean +digit?: # c: int -> eax: boolean # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -730,13 +730,13 @@ is-digit?: # c: int -> eax: boolean b8/copy-to-eax 0/imm32 # if (c < '0') return false 81 7/subop/compare 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 0x30/imm32 # compare *(ebp+8) - 7c/jump-if-< $is-digit?:end/disp8 + 7c/jump-if-< $digit?:end/disp8 # if (c > '9') return false 81 7/subop/compare 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 0x39/imm32 # compare *(ebp+8) - 7f/jump-if-> $is-digit?:end/disp8 + 7f/jump-if-> $digit?:end/disp8 # otherwise return true b8/copy-to-eax 1/imm32 -$is-digit?:end: +$digit?:end: # . epilogue 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . . # copy ebp to esp 5d/pop-to-ebp diff --git a/linux/dquotes b/linux/dquotes index f6e9134a..d523ca81 100755 Binary files a/linux/dquotes and b/linux/dquotes differ diff --git a/linux/dquotes.subx b/linux/dquotes.subx index 07feb0cc..6de81cc8 100644 --- a/linux/dquotes.subx +++ b/linux/dquotes.subx @@ -968,12 +968,12 @@ $emit-string-literal-data:emit: e8/call append-byte-hex/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp - # if (is-alphanumeric?(*curr)) print(out, "/#{*curr}") - # . var eax: boolean = is-alphanumeric?(CL) + # if (alphanumeric?(*curr)) print(out, "/#{*curr}") + # . var eax: boolean = alphanumeric?(CL) # . . push args 51/push-ecx # . . call - e8/call is-alphanumeric?/disp32 + e8/call alphanumeric?/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp # . if (eax == false) goto char-done @@ -1035,7 +1035,7 @@ $emit-string-literal-data:end: 5d/pop-to-ebp c3/return -is-alphanumeric?: # c: int -> eax: boolean +alphanumeric?: # c: int -> eax: boolean # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -1043,29 +1043,29 @@ is-alphanumeric?: # c: int -> eax: boolean 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 0/r32/eax 8/disp8 . # copy *(ebp+8) to eax # if (c < '0') return false 3d/compare-eax-with 0x30/imm32/0 - 7c/jump-if-< $is-alphanumeric?:false/disp8 + 7c/jump-if-< $alphanumeric?:false/disp8 # if (c <= '9') return true 3d/compare-eax-with 0x39/imm32/9 - 7e/jump-if-<= $is-alphanumeric?:true/disp8 + 7e/jump-if-<= $alphanumeric?:true/disp8 # if (c < 'A') return false 3d/compare-eax-with 0x41/imm32/A - 7c/jump-if-< $is-alphanumeric?:false/disp8 + 7c/jump-if-< $alphanumeric?:false/disp8 # if (c <= 'Z') return true 3d/compare-eax-with 0x5a/imm32/Z - 7e/jump-if-<= $is-alphanumeric?:true/disp8 + 7e/jump-if-<= $alphanumeric?:true/disp8 # if (c < 'a') return false 3d/compare-eax-with 0x61/imm32/a - 7c/jump-if-< $is-alphanumeric?:false/disp8 + 7c/jump-if-< $alphanumeric?:false/disp8 # if (c <= 'z') return true 3d/compare-eax-with 0x7a/imm32/z - 7e/jump-if-<= $is-alphanumeric?:true/disp8 + 7e/jump-if-<= $alphanumeric?:true/disp8 # return false -$is-alphanumeric?:false: +$alphanumeric?:false: b8/copy-to-eax 0/imm32/false - eb/jump $is-alphanumeric?:end/disp8 -$is-alphanumeric?:true: + eb/jump $alphanumeric?:end/disp8 +$alphanumeric?:true: b8/copy-to-eax 1/imm32/true -$is-alphanumeric?:end: +$alphanumeric?:end: # . epilogue 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . . # copy ebp to esp 5d/pop-to-ebp diff --git a/linux/hex b/linux/hex index 480e48a8..70293365 100755 Binary files a/linux/hex and b/linux/hex differ diff --git a/linux/hex.subx b/linux/hex.subx index ae80a13d..6024eb25 100644 --- a/linux/hex.subx +++ b/linux/hex.subx @@ -479,7 +479,7 @@ scan-next-byte: # in: (addr buffered-file), err: (addr buffered-file), ed: (add # while true # eax = read-byte-buffered(in) # if (eax == Eof) return eax - # if (is-hex-digit?(eax)) return eax + # if (hex-digit?(eax)) return eax # if (eax == ' ' or '\t' or '\n') continue # if (eax == '#') skip-until-newline(in) # else error-byte(ed, err, "invalid byte: " eax) @@ -499,14 +499,14 @@ $scan-next-byte:loop: # if (eax == Eof) return eax 3d/compare-with-eax 0xffffffff/imm32/Eof 74/jump-if-= $scan-next-byte:end/disp8 - # if (is-hex-digit?(eax)) return eax + # if (hex-digit?(eax)) return eax # . save eax for now 50/push-eax - # . is-hex-digit?(eax) + # . hex-digit?(eax) # . . push args 50/push-eax # . . call - e8/call is-hex-digit?/disp32 + e8/call hex-digit?/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp # . compare with 'false' diff --git a/linux/mu b/linux/mu index edf61e10..0e820706 100755 Binary files a/linux/mu and b/linux/mu differ diff --git a/linux/mu.subx b/linux/mu.subx index fa3bda75..e65fa9cc 100644 --- a/linux/mu.subx +++ b/linux/mu.subx @@ -16116,7 +16116,7 @@ $populate-mu-function-header:check-for-out: # if v->type is an addr, abort (lookup *ebx *(ebx+4)) # => eax (lookup *(eax+8) *(eax+0xc)) # Var-type Var-type => eax - (is-mu-addr-type? %eax) # => eax + (mu-addr-type? %eax) # => eax 3d/compare-eax-and 0/imm32/false 0f 85/jump-if-!= $populate-mu-function-header:error-addr-output/disp32 # out->outputs = append(v, out->outputs) @@ -16428,7 +16428,7 @@ $populate-mu-function-signature:check-for-out: 75/jump-if-!= break/disp8 (lookup *ebx *(ebx+4)) # => eax (lookup *(eax+8) *(eax+0xc)) # Var-type Var-type => eax - (is-mu-addr-type? %eax) # => eax + (mu-addr-type? %eax) # => eax 3d/compare-eax-and 0/imm32/false 0f 85/jump-if-!= $populate-mu-function-signature:error-addr-output/disp32 } @@ -16994,20 +16994,20 @@ $parse-var-with-type:check-register: (lookup *(edi+0x18) *(edi+0x1c)) # Var-register Var-register => eax 3d/compare-eax-and 0/imm32 74/jump-if-= $parse-var-with-type:end/disp8 - (is-float-register? %eax) # => eax + (float-register? %eax) # => eax { 3d/compare-eax-and 0/imm32/false 74/jump-if-= break/disp8 # var is in a float register; ensure type is float (lookup *(edi+8) *(edi+0xc)) # Var-type Var-type => eax - (is-simple-mu-type? %eax 0xf) # float => eax + (simple-mu-type? %eax 0xf) # float => eax 3d/compare-eax-and 0/imm32/false 0f 84/jump-if-= $parse-var-with-type:error-non-float-in-floating-point-register/disp32 eb/jump $parse-var-with-type:end/disp8 } # var is not in a float register; ensure type is not float (lookup *(edi+8) *(edi+0xc)) # Var-type Var-type => eax - (is-simple-mu-type? %eax 0xf) # float => eax + (simple-mu-type? %eax 0xf) # float => eax 3d/compare-eax-and 0/imm32/false 0f 85/jump-if-!= $parse-var-with-type:error-float-in-integer-register/disp32 $parse-var-with-type:end: @@ -17062,7 +17062,7 @@ $parse-var-with-type:error-non-float-in-floating-point-register: (stop *(ebp+0x1c) 1) # never gets here -is-float-register?: # r: (addr array byte) -> result/eax: boolean +float-register?: # r: (addr array byte) -> result/eax: boolean # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp @@ -17071,7 +17071,7 @@ is-float-register?: # r: (addr array byte) -> result/eax: boolean 81 7/subop/compare *eax 8/imm32/start-of-floating-point-registers 0f 9d/set-if->= %al 81 4/subop/and %eax 0xff/imm32 -$is-float-register?:end: +$float-register?:end: # . epilogue 89/<- %esp 5/r32/ebp 5d/pop-to-ebp @@ -17157,7 +17157,7 @@ $parse-type:check-for-int: 8a/copy-byte *eax 0/r32/AL 81 4/subop/and %eax 0xff/imm32 # TODO: raise an error on `var x: (array int a)` - (is-decimal-digit? %eax) # => eax + (decimal-digit? %eax) # => eax 3d/compare-eax-and 0/imm32/false 74/jump-if-= break/disp8 $parse-type:int: @@ -17764,14 +17764,14 @@ test-parse-var-with-compound-type: # identifier starts with a letter or '$' or '_' # no constraints at the moment on later letters # all we really want to do so far is exclude '{', '}' and '->' -is-identifier?: # in: (addr slice) -> result/eax: boolean +identifier?: # in: (addr slice) -> result/eax: boolean # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp # if (slice-empty?(in)) return false (slice-empty? *(ebp+8)) # => eax 3d/compare-eax-and 0/imm32/false - 75/jump-if-!= $is-identifier?:false/disp8 + 75/jump-if-!= $identifier?:false/disp8 # var c/eax: byte = *in->start 8b/-> *(ebp+8) 0/r32/eax 8b/-> *eax 0/r32/eax @@ -17779,25 +17779,25 @@ is-identifier?: # in: (addr slice) -> result/eax: boolean 81 4/subop/and %eax 0xff/imm32 # if (c == '$') return true 3d/compare-eax-and 0x24/imm32/$ - 74/jump-if-= $is-identifier?:true/disp8 + 74/jump-if-= $identifier?:true/disp8 # if (c == '_') return true 3d/compare-eax-and 0x5f/imm32/_ - 74/jump-if-= $is-identifier?:true/disp8 + 74/jump-if-= $identifier?:true/disp8 # drop case 25/and-eax-with 0x5f/imm32 # if (c < 'A') return false 3d/compare-eax-and 0x41/imm32/A - 7c/jump-if-< $is-identifier?:false/disp8 + 7c/jump-if-< $identifier?:false/disp8 # if (c > 'Z') return false 3d/compare-eax-and 0x5a/imm32/Z - 7f/jump-if-> $is-identifier?:false/disp8 + 7f/jump-if-> $identifier?:false/disp8 # otherwise return true -$is-identifier?:true: +$identifier?:true: b8/copy-to-eax 1/imm32/true - eb/jump $is-identifier?:end/disp8 -$is-identifier?:false: + eb/jump $identifier?:end/disp8 +$identifier?:false: b8/copy-to-eax 0/imm32/false -$is-identifier?:end: +$identifier?:end: # . epilogue 89/<- %esp 5/r32/ebp 5d/pop-to-ebp @@ -17817,7 +17817,7 @@ test-is-identifier-dollar: 50/push-eax 89/<- %ecx 4/r32/esp # - (is-identifier? %ecx) + (identifier? %ecx) (check-ints-equal %eax 1 "F - test-is-identifier-dollar") # . epilogue 89/<- %esp 5/r32/ebp @@ -17838,7 +17838,7 @@ test-is-identifier-underscore: 50/push-eax 89/<- %ecx 4/r32/esp # - (is-identifier? %ecx) + (identifier? %ecx) (check-ints-equal %eax 1 "F - test-is-identifier-underscore") # . epilogue 89/<- %esp 5/r32/ebp @@ -17859,7 +17859,7 @@ test-is-identifier-a: 50/push-eax 89/<- %ecx 4/r32/esp # - (is-identifier? %ecx) + (identifier? %ecx) (check-ints-equal %eax 1 "F - test-is-identifier-a") # . epilogue 89/<- %esp 5/r32/ebp @@ -17880,7 +17880,7 @@ test-is-identifier-z: 50/push-eax 89/<- %ecx 4/r32/esp # - (is-identifier? %ecx) + (identifier? %ecx) (check-ints-equal %eax 1 "F - test-is-identifier-z") # . epilogue 89/<- %esp 5/r32/ebp @@ -17901,7 +17901,7 @@ test-is-identifier-A: 50/push-eax 89/<- %ecx 4/r32/esp # - (is-identifier? %ecx) + (identifier? %ecx) (check-ints-equal %eax 1 "F - test-is-identifier-A") # . epilogue 89/<- %esp 5/r32/ebp @@ -17922,7 +17922,7 @@ test-is-identifier-Z: 50/push-eax 89/<- %ecx 4/r32/esp # - (is-identifier? %ecx) + (identifier? %ecx) (check-ints-equal %eax 1 "F - test-is-identifier-Z") # . epilogue 89/<- %esp 5/r32/ebp @@ -17944,7 +17944,7 @@ test-is-identifier-at: 50/push-eax 89/<- %ecx 4/r32/esp # - (is-identifier? %ecx) + (identifier? %ecx) (check-ints-equal %eax 0 "F - test-is-identifier-@") # . epilogue 89/<- %esp 5/r32/ebp @@ -17966,7 +17966,7 @@ test-is-identifier-square-bracket: 50/push-eax 89/<- %ecx 4/r32/esp # - (is-identifier? %ecx) + (identifier? %ecx) (check-ints-equal %eax 0 "F - test-is-identifier-@") # . epilogue 89/<- %esp 5/r32/ebp @@ -17988,7 +17988,7 @@ test-is-identifier-backtick: 50/push-eax 89/<- %ecx 4/r32/esp # - (is-identifier? %ecx) + (identifier? %ecx) (check-ints-equal %eax 0 "F - test-is-identifier-backtick") # . epilogue 89/<- %esp 5/r32/ebp @@ -18010,7 +18010,7 @@ test-is-identifier-curly-brace-open: 50/push-eax 89/<- %ecx 4/r32/esp # - (is-identifier? %ecx) + (identifier? %ecx) (check-ints-equal %eax 0 "F - test-is-identifier-curly-brace-open") # . epilogue 89/<- %esp 5/r32/ebp @@ -18031,7 +18031,7 @@ test-is-identifier-curly-brace-close: 50/push-eax 89/<- %ecx 4/r32/esp # - (is-identifier? %ecx) + (identifier? %ecx) (check-ints-equal %eax 0 "F - test-is-identifier-curly-brace-close") # . epilogue 89/<- %esp 5/r32/ebp @@ -18053,7 +18053,7 @@ test-is-identifier-hyphen: 50/push-eax 89/<- %ecx 4/r32/esp # - (is-identifier? %ecx) + (identifier? %ecx) (check-ints-equal %eax 0 "F - test-is-identifier-hyphen") # . epilogue 89/<- %esp 5/r32/ebp @@ -18516,7 +18516,7 @@ parse-mu-var-def: # line: (addr stream byte), vars: (addr stack live-var), out: 75/jump-if-!= break/disp8 # if v-addr->type == byte, abort (lookup *(esi+8) *(esi+0xc)) # Var-type Var-type => eax - (is-simple-mu-type? %eax 8) # byte => eax + (simple-mu-type? %eax 8) # byte => eax 3d/compare-eax-and 0/imm32/false 0f 85/jump-if-!= $parse-mu-var-def:error-byte-on-stack/disp32 # ensure that there's nothing else on this line @@ -18534,7 +18534,7 @@ parse-mu-var-def: # line: (addr stream byte), vars: (addr stack live-var), out: # if v-addr->type == byte, check for unsupported registers { (lookup *(esi+8) *(esi+0xc)) # Var-type Var-type => eax - (is-simple-mu-type? %eax 8) # byte => eax + (simple-mu-type? %eax 8) # byte => eax 3d/compare-eax-and 0/imm32/false 74/jump-if-= break/disp8 (lookup *(esi+0x18) *(esi+0x1c)) # => eax @@ -18748,7 +18748,7 @@ parse-mu-stmt: # line: (addr stream byte), vars: (addr stack live-var), fn: (ad # while true # name = next-mu-token(line) # if (name == '<-') break - # assert(is-identifier?(name)) + # assert(identifier?(name)) # var v: (handle var) = lookup-var(name, vars) # out-addr->outputs = append(v, out-addr->outputs) # add-operation-and-inputs-to-stmt(out-addr, line, vars) @@ -18802,8 +18802,8 @@ $parse-mu-stmt:read-outputs: 81 4/subop/and %eax 0xff/imm32 3d/compare-eax-and 0x2a/imm32/asterisk 0f 84/jump-if-= $parse-mu-stmt:error-output-dereferenced/disp32 - # assert(is-identifier?(name)) - (is-identifier? %ecx) # => eax + # assert(identifier?(name)) + (identifier? %ecx) # => eax 3d/compare-eax-and 0/imm32/false 0f 84/jump-if-= $parse-mu-stmt:abort/disp32 # @@ -18904,7 +18904,7 @@ $add-operation-and-inputs-to-stmt:read-inouts: (slice-equal? %ecx "<-") 3d/compare-eax-and 0/imm32/false 0f 85/jump-if-!= $add-operation-and-inputs-to-stmt:abort/disp32 - # if (is-get? && second operand) lookup or create offset + # if (get? && second operand) lookup or create offset { 81 7/subop/compare %ebx 0/imm32/false 74/jump-if-= break/disp8 @@ -18938,7 +18938,7 @@ $add-operation-and-inputs-to-stmt:inout-is-deref: ba/copy-to-edx 1/imm32/true } (lookup-var-or-literal %ecx *(ebp+0x10) %esi *(ebp+0x14) *(ebp+0x18) *(ebp+0x1c)) - # if (is-deref?) some additional checks + # if (deref?) some additional checks 81 7/subop/compare %edx 0/imm32/false { 74/jump-if-= break/disp8 @@ -18948,7 +18948,7 @@ $add-operation-and-inputs-to-stmt:inout-is-deref: 0f 84/jump-if-= $add-operation-and-inputs-to-stmt:error-deref-on-stack/disp32 # if var is not an address, abort (lookup *(eax+8) *(eax+0xc)) # Var-type Var-type => eax - (is-mu-addr-type? %eax) # => eax + (mu-addr-type? %eax) # => eax 3d/compare-eax-and 0/imm32/false 0f 84/jump-if-= $add-operation-and-inputs-to-stmt:error-deref-non-addr/disp32 } @@ -19085,11 +19085,11 @@ lookup-var-or-literal: # name: (addr slice), vars: (addr stack live-var), out: 8b/-> *esi 1/r32/ecx 8a/copy-byte *ecx 1/r32/CL 81 4/subop/and %ecx 0xff/imm32 - # if (is-decimal-digit?(c) || c == '-') return new var(name) + # if (decimal-digit?(c) || c == '-') return new var(name) { 81 7/subop/compare %ecx 0x2d/imm32/dash 74/jump-if-= $lookup-var-or-literal:literal/disp8 - (is-decimal-digit? %ecx) # => eax + (decimal-digit? %ecx) # => eax 3d/compare-eax-and 0/imm32/false 74/jump-if-= break/disp8 $lookup-var-or-literal:literal: @@ -19748,7 +19748,7 @@ new-literal-integer: # ad: (addr allocation-descriptor), name: (addr slice), ou 8b/-> *(ebp+0xc) 1/r32/ecx (next-token-from-slice *ecx *(ecx+4) 0x2f *(ebp+0xc)) # if (!is-hex-int?(name)) abort - (is-hex-int? *(ebp+0xc)) # => eax + (hex-int? *(ebp+0xc)) # => eax 3d/compare-eax-and 0/imm32/false 0f 84/jump-if-= $new-literal-integer:abort/disp32 # a little more error-checking @@ -20222,7 +20222,7 @@ $container-type:end: 5d/pop-to-ebp c3/return -is-container?: # t: type-id -> result/eax: boolean +container?: # t: type-id -> result/eax: boolean # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp @@ -20232,7 +20232,7 @@ is-container?: # t: type-id -> result/eax: boolean 3b/compare 0/r32/eax *Primitive-type-ids 0f 9d/set-if->= %al 81 4/subop/and %eax 0xff/imm32 -$is-container?:end: +$container?:end: # . epilogue 89/<- %esp 5/r32/ebp 5d/pop-to-ebp @@ -20561,31 +20561,31 @@ $populate-mu-type:parse-element: # if v is an addr, abort (lookup *esi *(esi+4)) # => eax (lookup *(eax+8) *(eax+0xc)) # Var-type Var-type => eax - (is-mu-addr-type? %eax) # => eax + (mu-addr-type? %eax) # => eax 3d/compare-eax-and 0/imm32/false 0f 85/jump-if-!= $populate-mu-type:error2/disp32 # if v is an array, abort (we could support it, but initialization gets complex) (lookup *esi *(esi+4)) # => eax (lookup *(eax+8) *(eax+0xc)) # Var-type Var-type => eax - (is-mu-array-type? %eax) # => eax + (mu-array-type? %eax) # => eax 3d/compare-eax-and 0/imm32/false 0f 85/jump-if-!= $populate-mu-type:error3/disp32 # if v is a byte, abort (lookup *esi *(esi+4)) # => eax (lookup *(eax+8) *(eax+0xc)) # Var-type Var-type => eax - (is-simple-mu-type? %eax 8) # byte => eax + (simple-mu-type? %eax 8) # byte => eax 3d/compare-eax-and 0/imm32/false 0f 85/jump-if-!= $populate-mu-type:error4/disp32 # if v is a slice, abort (lookup *esi *(esi+4)) # => eax (lookup *(eax+8) *(eax+0xc)) # Var-type Var-type => eax - (is-simple-mu-type? %eax 0xc) # slice => eax + (simple-mu-type? %eax 0xc) # slice => eax 3d/compare-eax-and 0/imm32/false 0f 85/jump-if-!= $populate-mu-type:error5/disp32 # if v is a stream, abort (we could support it, but initialization gets even more complex) (lookup *esi *(esi+4)) # => eax (lookup *(eax+8) *(eax+0xc)) # Var-type Var-type => eax - (is-mu-stream-type? %eax) # => eax + (mu-stream-type? %eax) # => eax 3d/compare-eax-and 0/imm32/false 0f 85/jump-if-!= $populate-mu-type:error6/disp32 # var tmp/ecx @@ -21838,13 +21838,13 @@ check-mu-numberlike-arg: # v: (addr stmt-var), stmt: (addr stmt), fn: (addr fun 89/<- %esi 0/r32/eax $check-mu-numberlike-arg:check-literal: # if t is an int, return - (is-simple-mu-type? %esi 0) # literal => eax + (simple-mu-type? %esi 0) # literal => eax 3d/compare-eax-and 0/imm32/false 0f 85/jump-if-!= $check-mu-numberlike-arg:end/disp32 $check-mu-numberlike-arg:check-addr: # if t is an addr and v is dereferenced, return whether t->payload is an addr { - (is-mu-addr-type? %esi) # => eax + (mu-addr-type? %esi) # => eax 3d/compare-eax-and 0/imm32/false 74/jump-if-= break/disp8 8b/-> *(ebp+8) 0/r32/eax @@ -21859,7 +21859,7 @@ $check-mu-numberlike-arg:check-addr: 75/jump-if-!= break/disp8 (lookup *(eax+4) *(eax+8)) # Type-tree-left Type-tree-left => eax } - (is-mu-addr-type? %eax) # => eax + (mu-addr-type? %eax) # => eax 3d/compare-eax-and 0/imm32/false 74/jump-if-= $check-mu-numberlike-arg:end/disp8 } @@ -21882,7 +21882,7 @@ check-mu-numberlike-output: # v: (addr stmt-var), stmt: (addr stmt), fn: (addr # . save registers 50/push-eax # - (is-mu-numberlike-output-var? *(ebp+8)) # => eax + (mu-numberlike-output-var? *(ebp+8)) # => eax 3d/compare-eax-and 0/imm32/false 0f 84/jump-if-= $check-mu-numberlike-output:fail/disp32 $check-mu-numberlike-output:end: @@ -21913,7 +21913,7 @@ $check-mu-numberlike-output:fail: (stop *(ebp+0x18) 1) # never gets here -is-mu-numberlike-output-var?: # v: (addr stmt-var) -> result/eax: boolean +mu-numberlike-output-var?: # v: (addr stmt-var) -> result/eax: boolean # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp @@ -21921,14 +21921,14 @@ is-mu-numberlike-output-var?: # v: (addr stmt-var) -> result/eax: boolean 8b/-> *(ebp+8) 0/r32/eax (lookup *eax *(eax+4)) # Stmt-var-value Stmt-var-value => eax (lookup *(eax+8) *(eax+0xc)) # Var-type Var-type => eax - (is-mu-numberlike-output? %eax) # => eax -$is-mu-numberlike-output-var?:end: + (mu-numberlike-output? %eax) # => eax +$mu-numberlike-output-var?:end: # . epilogue 89/<- %esp 5/r32/ebp 5d/pop-to-ebp c3/return -is-mu-numberlike-output?: # v: (addr type-tree) -> result/eax: boolean +mu-numberlike-output?: # v: (addr type-tree) -> result/eax: boolean # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp @@ -21936,42 +21936,42 @@ is-mu-numberlike-output?: # v: (addr type-tree) -> result/eax: boolean 56/push-esi # var t/esi: (addr type-tree) = lookup(v->value->type) 8b/-> *(ebp+8) 6/r32/esi -$is-mu-numberlike-output?:check-int: +$mu-numberlike-output?:check-int: # if t is an int, return - (is-simple-mu-type? %esi 1) # int => eax + (simple-mu-type? %esi 1) # int => eax 3d/compare-eax-and 0/imm32/false - 0f 85/jump-if-!= $is-mu-numberlike-output?:return-true/disp32 -$is-mu-numberlike-output?:check-float: + 0f 85/jump-if-!= $mu-numberlike-output?:return-true/disp32 +$mu-numberlike-output?:check-float: # if t is a float, return - (is-simple-mu-type? %esi 0xf) # float => eax + (simple-mu-type? %esi 0xf) # float => eax 3d/compare-eax-and 0/imm32/false - 75/jump-if-!= $is-mu-numberlike-output?:return-true/disp8 -$is-mu-numberlike-output?:check-boolean: + 75/jump-if-!= $mu-numberlike-output?:return-true/disp8 +$mu-numberlike-output?:check-boolean: # if t is a boolean, return - (is-simple-mu-type? %esi 5) # boolean => eax + (simple-mu-type? %esi 5) # boolean => eax 3d/compare-eax-and 0/imm32/false - 75/jump-if-!= $is-mu-numberlike-output?:return-true/disp8 -$is-mu-numberlike-output?:check-byte: + 75/jump-if-!= $mu-numberlike-output?:return-true/disp8 +$mu-numberlike-output?:check-byte: # if t is a byte, return - (is-simple-mu-type? %esi 8) # byte => eax + (simple-mu-type? %esi 8) # byte => eax 3d/compare-eax-and 0/imm32/false - 75/jump-if-!= $is-mu-numberlike-output?:return-true/disp8 -$is-mu-numberlike-output?:check-code-point: + 75/jump-if-!= $mu-numberlike-output?:return-true/disp8 +$mu-numberlike-output?:check-code-point: # if t is a code-point, return - (is-simple-mu-type? %esi 0xd) # code-point => eax + (simple-mu-type? %esi 0xd) # code-point => eax 3d/compare-eax-and 0/imm32/false - 75/jump-if-!= $is-mu-numberlike-output?:return-true/disp8 -$is-mu-numberlike-output?:check-grapheme: + 75/jump-if-!= $mu-numberlike-output?:return-true/disp8 +$mu-numberlike-output?:check-grapheme: # if t is a grapheme, return - (is-simple-mu-type? %esi 0xe) # grapheme => eax + (simple-mu-type? %esi 0xe) # grapheme => eax 3d/compare-eax-and 0/imm32/false - 75/jump-if-!= $is-mu-numberlike-output?:return-true/disp8 -$is-mu-numberlike-output?:return-false: + 75/jump-if-!= $mu-numberlike-output?:return-true/disp8 +$mu-numberlike-output?:return-false: b8/copy-to-eax 0/imm32/false - eb/jump $is-mu-numberlike-output?:end/disp8 -$is-mu-numberlike-output?:return-true: + eb/jump $mu-numberlike-output?:end/disp8 +$mu-numberlike-output?:return-true: b8/copy-to-eax 1/imm32/true -$is-mu-numberlike-output?:end: +$mu-numberlike-output?:end: # . restore registers 5e/pop-to-esi # . epilogue @@ -22059,7 +22059,7 @@ $check-mu-copy-stmt:types: { (lookup *edi *(edi+4)) # Stmt-var-value Stmt-var-value => eax (lookup *(eax+8) *(eax+0xc)) # Var-type Var-type => eax - (is-mu-addr-type? %eax) # => eax + (mu-addr-type? %eax) # => eax 3d/compare-eax-and 0/imm32/false 74/jump-if-= break/disp8 (lookup *esi *(esi+4)) # Stmt-var-value Stmt-var-value => eax @@ -22076,7 +22076,7 @@ $check-mu-copy-stmt:types: 81 7/subop/compare *eax 0/imm32/false # Type-tree-is-atom 75/jump-if-!= break/disp8 (lookup *(eax+4) *(eax+8)) # Type-tree-left Type-tree-left => eax - (is-simple-mu-type? %eax 7) # offset => eax + (simple-mu-type? %eax 7) # offset => eax 3d/compare-eax-and 0/imm32/false 74/jump-if-= break/disp8 (lookup *esi *(esi+4)) # Stmt-var-value Stmt-var-value => eax @@ -22090,12 +22090,12 @@ $check-mu-copy-stmt:types: { (lookup *edi *(edi+4)) # Stmt-var-value Stmt-var-value => eax (lookup *(eax+8) *(eax+0xc)) # Var-type Var-type => eax - (is-simple-mu-type? %eax 8) # byte => eax + (simple-mu-type? %eax 8) # byte => eax 3d/compare-eax-and 0/imm32/false 74/jump-if-= break/disp8 (lookup *esi *(esi+4)) # Stmt-var-value Stmt-var-value => eax (lookup *(eax+8) *(eax+0xc)) # Var-type Var-type => eax - (is-simple-mu-type? %eax 0) # literal => eax + (simple-mu-type? %eax 0) # literal => eax 3d/compare-eax-and 0/imm32/false 0f 84/jump-if-= $check-mu-copy-stmt:error-non-literal-to-byte/disp32 eb/jump $check-mu-copy-stmt:end/disp8 @@ -22255,7 +22255,7 @@ $check-mu-copy-to-stmt:types: { (lookup *esi *(esi+4)) # Stmt-var-value Stmt-var-value => eax (lookup *(eax+0x8) *(eax+0xc)) # Var-type Var-type => eax - (is-simple-mu-type? %eax 0) # => eax + (simple-mu-type? %eax 0) # => eax 3d/compare-eax-and 0/imm32 75/jump-if-!= break/disp8 (lookup *esi *(esi+4)) # Stmt-var-value Stmt-var-value => eax @@ -22288,10 +22288,10 @@ $check-mu-copy-to-stmt:dest-is-deref2: # if dest is a byte and src is not a literal, abort { $check-mu-copy-to-stmt:final-check-byte: - (is-simple-mu-type? %ebx 8) # byte => eax + (simple-mu-type? %ebx 8) # byte => eax 3d/compare-eax-and 0/imm32/false 74/jump-if-= break/disp8 - (is-simple-mu-type? %ecx 0) # literal => eax + (simple-mu-type? %ecx 0) # literal => eax 3d/compare-eax-and 0/imm32/false 0f 84/jump-if-= $check-mu-copy-to-stmt:error-non-literal-to-byte/disp32 } @@ -22302,7 +22302,7 @@ $check-mu-copy-to-stmt:final-check-byte: # if dest is an addr and src is 0, return { $check-mu-copy-to-stmt:final-check-addr: - (is-mu-addr-type? %ebx) # => eax + (mu-addr-type? %ebx) # => eax 3d/compare-eax-and 0/imm32/false 74/jump-if-= break/disp8 (lookup *esi *(esi+4)) # Stmt-var-value Stmt-var-value => eax @@ -22318,7 +22318,7 @@ $check-mu-copy-to-stmt:final-check-offset: 81 7/subop/compare *ebx 0/imm32/false # Type-tree-is-atom 75/jump-if-!= break/disp8 (lookup *(ebx+4) *(ebx+8)) # Type-tree-left Type-tree-left => eax - (is-simple-mu-type? %eax 7) # offset => eax + (simple-mu-type? %eax 7) # offset => eax 3d/compare-eax-and 0/imm32/false 74/jump-if-= break/disp8 (lookup *esi *(esi+4)) # Stmt-var-value Stmt-var-value => eax @@ -22475,7 +22475,7 @@ $check-mu-copy-byte-stmt:inout-is-deref2: (lookup *edi *(edi+4)) # Stmt-var-value Stmt-var-value => eax (lookup *(eax+8) *(eax+0xc)) # Var-type Var-type => eax # if output is not of type byte, abort - (is-simple-mu-type? %eax 8) # byte => eax + (simple-mu-type? %eax 8) # byte => eax 3d/compare-eax-and 0/imm32 0f 84/jump-if-= $check-mu-copy-byte-stmt:error-invalid-output-type/disp32 $check-mu-copy-byte-stmt:end: @@ -22647,7 +22647,7 @@ $check-mu-copy-byte-to-stmt:dest-is-deref2: 89/<- %ebx 0/r32/eax } # if dest is not a byte, abort - (is-simple-mu-type? %ebx 8) # byte => eax + (simple-mu-type? %ebx 8) # byte => eax 3d/compare-eax-and 0/imm32/false 0f 84/jump-if-= $check-mu-copy-byte-to-stmt:error-invalid-dest-type/disp32 $check-mu-copy-byte-to-stmt:end: @@ -22769,7 +22769,7 @@ $check-mu-compare-stmt:get-right: $check-mu-compare-stmt:both-in-mem: (lookup *esi *(esi+4)) # Stmt-var-value Stmt-var-value => eax (lookup *(eax+0x8) *(eax+0xc)) # Var-type Var-type => eax - (is-simple-mu-type? %eax 0) # => eax + (simple-mu-type? %eax 0) # => eax 3d/compare-eax-and 0/imm32 0f 85/jump-if-!= break/disp32 (lookup *esi *(esi+4)) # Stmt-var-value Stmt-var-value => eax @@ -22778,7 +22778,7 @@ $check-mu-compare-stmt:both-in-mem: 75/jump-if-!= break/disp8 (lookup *edi *(edi+4)) # Stmt-var-value Stmt-var-value => eax (lookup *(eax+0x8) *(eax+0xc)) # Var-type Var-type => eax - (is-simple-mu-type? %eax 0) # => eax + (simple-mu-type? %eax 0) # => eax 3d/compare-eax-and 0/imm32 75/jump-if-!= break/disp8 (lookup *edi *(edi+4)) # Stmt-var-value Stmt-var-value => eax @@ -22807,7 +22807,7 @@ $check-mu-compare-stmt:types: 89/<- %ecx 0/r32/eax } # if right-type is a literal string, abort - (is-simple-mu-type? %ecx 0x10) # string-literal => eax + (simple-mu-type? %ecx 0x10) # string-literal => eax 3d/compare-eax-and 0/imm32/false 0f 85/jump-if-!= $check-mu-compare-stmt:error-right-string-literal/disp32 # if right is not a scalar, abort @@ -22846,7 +22846,7 @@ $check-mu-compare-stmt:types: { (lookup *edi *(edi+4)) # Stmt-var-value Stmt-var-value => eax (lookup *(eax+8) *(eax+0xc)) # Var-type Var-type => eax - (is-mu-addr-type? %eax) # => eax + (mu-addr-type? %eax) # => eax 3d/compare-eax-and 0/imm32/false 74/jump-if-= break/disp8 (lookup *esi *(esi+4)) # Stmt-var-value Stmt-var-value => eax @@ -22990,7 +22990,7 @@ $check-mu-address-stmt:types: (lookup *(eax+8) *(eax+0xc)) # Var-type Var-type => eax 89/<- %edx 0/r32/eax # if output-type not an addr, abort - (is-mu-addr-type? %edx) # => eax + (mu-addr-type? %edx) # => eax 3d/compare-eax-and 0/imm32/false 0f 84/jump-if-= $check-mu-address-stmt:error-output-not-address/disp32 # output-type = output-type->right @@ -23146,7 +23146,7 @@ type-equal-ignoring-capacity?: # a: (addr type-tree), b: (addr type-tree) -> re 0f 84/jump-if-= $type-equal-ignoring-capacity?:end/disp32 # eax switches meaning # if (curr-a->left == "array") curr-a = curr-a->element-type { - (is-mu-array? %edx) # => eax + (mu-array? %edx) # => eax 3d/compare-eax-and 0/imm32/false 75/jump-if-!= break/disp8 $type-equal-ignoring-capacity?:array: @@ -23162,7 +23162,7 @@ $type-equal-ignoring-capacity?:array: } # if (curr-a->left == "stream") curr-a = curr-a->element-type { - (is-mu-stream? %edx) # => eax + (mu-stream? %edx) # => eax 3d/compare-eax-and 0/imm32/false 75/jump-if-!= break/disp8 $type-equal-ignoring-capacity?:stream: @@ -23243,10 +23243,10 @@ check-mu-return-stmt: # stmt: (addr stmt), fn: (addr function), err: (addr buff # if curr-type is literal and template-type is float, abort 50/push-eax { - (is-simple-mu-type? %eax 0) # literal => eax + (simple-mu-type? %eax 0) # literal => eax 3d/compare-eax-and 0/imm32/false 74/jump-if-= break/disp8 - (is-simple-mu-type? %ecx 0xf) # float => eax + (simple-mu-type? %ecx 0xf) # float => eax 3d/compare-eax-and 0/imm32/false 0f 85/jump-if-!= $check-mu-return-stmt:error-literal-to-float/disp32 } @@ -23697,7 +23697,7 @@ $check-mu-get-stmt:check-base: $check-mu-get-stmt:base-is-compound: # if (type->left != addr) break (lookup *(ebx+4) *(ebx+8)) # Type-tree-left Type-tree-left => eax - (is-simple-mu-type? %eax 2) # addr => eax + (simple-mu-type? %eax 2) # addr => eax 3d/compare-eax-and 0/imm32/false 74/jump-if-= break/disp8 $check-mu-get-stmt:base-is-addr: @@ -23723,7 +23723,7 @@ $check-mu-get-stmt:check-base-typeinfo: } # var base-type-id/ebx: type-id = base-type->value 8b/-> *(ebx+4) 3/r32/ebx # Type-tree-value - (is-container? %ebx) # => eax + (container? %ebx) # => eax 3d/compare-eax-and 0/imm32/false 0f 84/jump-if-= $check-mu-get-stmt:error-bad-base/disp32 # var base-typeinfo/edx: (addr typeinfo) = find-typeinfo(base-type-id) @@ -23776,7 +23776,7 @@ $check-mu-get-stmt:check-output-type: 0f 85/jump-if-!= $check-mu-get-stmt:error-output-type-not-address/disp32 # type must start with (addr ...) (lookup *(eax+4) *(eax+8)) # Type-tree-left Type-tree-left => eax - (is-simple-mu-type? %eax 2) # => eax + (simple-mu-type? %eax 2) # => eax 3d/compare-eax-and 0/imm32/false 0f 84/jump-if-= $check-mu-get-stmt:error-output-type-not-address/disp32 $check-mu-get-stmt:check-output-type-match: @@ -23989,7 +23989,7 @@ $check-mu-index-stmt:check-no-inouts: 81 7/subop/compare *ebx 0/imm32/false # Type-tree-is-atom { 74/jump-if-= break/disp8 - (is-simple-mu-type? %ebx 3) # array => eax + (simple-mu-type? %ebx 3) # array => eax 3d/compare-eax-and 0/imm32/false 0f 85/jump-if-!= $check-mu-index-stmt:error-base-array-atom-type/disp32 0f 84/jump-if-= $check-mu-index-stmt:error-base-non-array-type/disp32 @@ -23998,11 +23998,11 @@ $check-mu-index-stmt:base-is-compound: # if type->left not addr or array, abort { (lookup *(ebx+4) *(ebx+8)) # Type-tree-left Type-tree-left => eax - (is-simple-mu-type? %eax 2) # addr => eax + (simple-mu-type? %eax 2) # addr => eax 3d/compare-eax-and 0/imm32/false 75/jump-if-!= break/disp8 (lookup *(ebx+4) *(ebx+8)) # Type-tree-left Type-tree-left => eax - (is-simple-mu-type? %eax 3) # array => eax + (simple-mu-type? %eax 3) # array => eax 3d/compare-eax-and 0/imm32/false 75/jump-if-!= break/disp8 e9/jump $check-mu-index-stmt:error-base-non-array-type/disp32 @@ -24010,13 +24010,13 @@ $check-mu-index-stmt:base-is-compound: # if (type->left == addr) ensure type->right->left == array and type->register exists { (lookup *(ebx+4) *(ebx+8)) # Type-tree-left Type-tree-left => eax - (is-simple-mu-type? %eax 2) # addr => eax + (simple-mu-type? %eax 2) # addr => eax 3d/compare-eax-and 0/imm32/false 74/jump-if-= break/disp8 $check-mu-index-stmt:base-is-addr: (lookup *(ebx+0xc) *(ebx+0x10)) # Type-tree-right Type-tree-right => eax (lookup *(eax+4) *(eax+8)) # Type-tree-left Type-tree-left => eax - (is-simple-mu-type? %eax 3) # array => eax + (simple-mu-type? %eax 3) # array => eax 3d/compare-eax-and 0/imm32/false 0f 84/jump-if-= $check-mu-index-stmt:error-base-non-array-type/disp32 $check-mu-index-stmt:check-base-addr-is-register: @@ -24026,7 +24026,7 @@ $check-mu-index-stmt:check-base-addr-is-register: # if (type->left == array) ensure type->register doesn't exist { (lookup *(ebx+4) *(ebx+8)) # Type-tree-left Type-tree-left => eax - (is-simple-mu-type? %eax 3) # array => eax + (simple-mu-type? %eax 3) # array => eax 3d/compare-eax-and 0/imm32/false 74/jump-if-= break/disp8 $check-mu-index-stmt:base-is-array: @@ -24036,7 +24036,7 @@ $check-mu-index-stmt:base-is-array: # if (base-type->left == addr) base-type = base-type->right { (lookup *(ebx+4) *(ebx+8)) # Type-tree-left Type-tree-left => eax - (is-simple-mu-type? %eax 2) # addr => eax + (simple-mu-type? %eax 2) # addr => eax 3d/compare-eax-and 0/imm32/false 74/jump-if-= break/disp8 (lookup *(ebx+0xc) *(ebx+0x10)) # Type-tree-right Type-tree-right => eax @@ -24060,13 +24060,13 @@ $check-mu-index-stmt:check-single-inout: { 74/jump-if-= break/disp8 $check-mu-index-stmt:index-type-is-atom: - (is-simple-mu-type? %edx 0) # literal => eax + (simple-mu-type? %edx 0) # literal => eax 3d/compare-eax-and 0/imm32/false 75/jump-if-!= $check-mu-index-stmt:index-type-done/disp8 - (is-simple-mu-type? %edx 1) # int => eax + (simple-mu-type? %edx 1) # int => eax 3d/compare-eax-and 0/imm32/false 75/jump-if-!= $check-mu-index-stmt:index-type-done/disp8 - (is-simple-mu-type? %edx 7) # offset => eax + (simple-mu-type? %edx 7) # offset => eax 3d/compare-eax-and 0/imm32/false 0f 85/jump-if-!= $check-mu-index-stmt:error-index-offset-atom-type/disp32 e9/jump $check-mu-index-stmt:error-invalid-index-type/disp32 @@ -24076,14 +24076,14 @@ $check-mu-index-stmt:index-type-is-atom: 75/jump-if-!= break/disp8 $check-mu-index-stmt:index-type-is-non-atom: (lookup *(edx+4) *(edx+8)) # Type-tree-left Type-tree-left => eax - (is-simple-mu-type? %eax 7) # offset => eax + (simple-mu-type? %eax 7) # offset => eax 3d/compare-eax-and 0/imm32/false 0f 84/jump-if-= $check-mu-index-stmt:error-invalid-index-type/disp32 } $check-mu-index-stmt:index-type-done: # check index is either a literal or in a register { - (is-simple-mu-type? %edx 0) # literal => eax + (simple-mu-type? %edx 0) # literal => eax 3d/compare-eax-and 0/imm32/false 75/jump-if-!= break/disp8 $check-mu-index-stmt:check-index-in-register: @@ -24092,7 +24092,7 @@ $check-mu-index-stmt:check-index-in-register: } # - if index is an 'int', check that element type of base has size 1, 2, 4 or 8 bytes. { - (is-simple-mu-type? %edx 1) # int => eax + (simple-mu-type? %edx 1) # int => eax 3d/compare-eax-and 0/imm32/false 74/jump-if-= break/disp8 $check-mu-index-stmt:check-index-can-be-int: @@ -24130,7 +24130,7 @@ $check-mu-index-stmt:check-index-can-be-int: 0f 85/jump-if-!= $check-mu-index-stmt:error-output-type-not-address/disp32 # type must start with (addr ...) (lookup *(edx+4) *(edx+8)) # Type-tree-left Type-tree-left => eax - (is-simple-mu-type? %eax 2) # addr => eax + (simple-mu-type? %eax 2) # addr => eax 3d/compare-eax-and 0/imm32/false 0f 84/jump-if-= $check-mu-index-stmt:error-output-type-not-address/disp32 # if tail(base-type) != tail(output-type) abort @@ -24372,7 +24372,7 @@ $check-mu-length-stmt:check-no-inouts: 81 7/subop/compare *ebx 0/imm32/false # Type-tree-is-atom { 74/jump-if-= break/disp8 - (is-simple-mu-type? %ebx 3) # array => eax + (simple-mu-type? %ebx 3) # array => eax 3d/compare-eax-and 0/imm32/false 0f 85/jump-if-!= $check-mu-length-stmt:error-base-array-atom-type/disp32 0f 84/jump-if-= $check-mu-length-stmt:error-base-non-array-type/disp32 @@ -24381,11 +24381,11 @@ $check-mu-length-stmt:base-is-compound: # if type->left not addr or array, abort { (lookup *(ebx+4) *(ebx+8)) # Type-tree-left Type-tree-left => eax - (is-simple-mu-type? %eax 2) # addr => eax + (simple-mu-type? %eax 2) # addr => eax 3d/compare-eax-and 0/imm32/false 75/jump-if-!= break/disp8 (lookup *(ebx+4) *(ebx+8)) # Type-tree-left Type-tree-left => eax - (is-simple-mu-type? %eax 3) # array => eax + (simple-mu-type? %eax 3) # array => eax 3d/compare-eax-and 0/imm32/false 75/jump-if-!= break/disp8 e9/jump $check-mu-length-stmt:error-base-non-array-type/disp32 @@ -24393,13 +24393,13 @@ $check-mu-length-stmt:base-is-compound: # if (type->left == addr) ensure type->right->left == array and type->register exists { (lookup *(ebx+4) *(ebx+8)) # Type-tree-left Type-tree-left => eax - (is-simple-mu-type? %eax 2) # addr => eax + (simple-mu-type? %eax 2) # addr => eax 3d/compare-eax-and 0/imm32/false 74/jump-if-= break/disp8 $check-mu-length-stmt:base-is-addr: (lookup *(ebx+0xc) *(ebx+0x10)) # Type-tree-right Type-tree-right => eax (lookup *(eax+4) *(eax+8)) # Type-tree-left Type-tree-left => eax - (is-simple-mu-type? %eax 3) # array => eax + (simple-mu-type? %eax 3) # array => eax 3d/compare-eax-and 0/imm32/false 0f 84/jump-if-= $check-mu-length-stmt:error-base-non-array-type/disp32 $check-mu-length-stmt:check-base-addr-is-register: @@ -24409,7 +24409,7 @@ $check-mu-length-stmt:check-base-addr-is-register: # if (type->left == array) ensure type->register doesn't exist { (lookup *(ebx+4) *(ebx+8)) # Type-tree-left Type-tree-left => eax - (is-simple-mu-type? %eax 3) # array => eax + (simple-mu-type? %eax 3) # array => eax 3d/compare-eax-and 0/imm32/false 74/jump-if-= break/disp8 $check-mu-length-stmt:base-is-array: @@ -24419,7 +24419,7 @@ $check-mu-length-stmt:base-is-array: # if (base-type->left == addr) base-type = base-type->right { (lookup *(ebx+4) *(ebx+8)) # Type-tree-left Type-tree-left => eax - (is-simple-mu-type? %eax 2) # addr => eax + (simple-mu-type? %eax 2) # addr => eax 3d/compare-eax-and 0/imm32/false 74/jump-if-= break/disp8 (lookup *(ebx+0xc) *(ebx+0x10)) # Type-tree-right Type-tree-right => eax @@ -24440,7 +24440,7 @@ $check-mu-length-stmt:base-is-array: # - check output type # must have a non-atomic type (lookup *(edi+8) *(edi+0xc)) # Var-type Var-type => eax - (is-simple-mu-type? %eax 1) # int => eax + (simple-mu-type? %eax 1) # int => eax 3d/compare-eax-and 0/imm32/false 0f 84/jump-if-= $check-mu-length-stmt:error-invalid-output-type/disp32 # - check for too many outputs @@ -24662,7 +24662,7 @@ $check-mu-compute-offset-stmt:check-no-inouts: 81 7/subop/compare *ebx 0/imm32/false # Type-tree-is-atom { 74/jump-if-= break/disp8 - (is-simple-mu-type? %ebx 3) # array => eax + (simple-mu-type? %ebx 3) # array => eax 3d/compare-eax-and 0/imm32/false 0f 85/jump-if-!= $check-mu-compute-offset-stmt:error-base-array-atom-type/disp32 0f 84/jump-if-= $check-mu-compute-offset-stmt:error-base-non-array-type/disp32 @@ -24671,11 +24671,11 @@ $check-mu-compute-offset-stmt:base-is-compound: # if type->left not addr or array, abort { (lookup *(ebx+4) *(ebx+8)) # Type-tree-left Type-tree-left => eax - (is-simple-mu-type? %eax 2) # addr => eax + (simple-mu-type? %eax 2) # addr => eax 3d/compare-eax-and 0/imm32/false 75/jump-if-!= break/disp8 (lookup *(ebx+4) *(ebx+8)) # Type-tree-left Type-tree-left => eax - (is-simple-mu-type? %eax 3) # array => eax + (simple-mu-type? %eax 3) # array => eax 3d/compare-eax-and 0/imm32/false 75/jump-if-!= break/disp8 e9/jump $check-mu-compute-offset-stmt:error-base-non-array-type/disp32 @@ -24683,20 +24683,20 @@ $check-mu-compute-offset-stmt:base-is-compound: # if (type->left == addr) ensure type->right->left == array and type->register exists { (lookup *(ebx+4) *(ebx+8)) # Type-tree-left Type-tree-left => eax - (is-simple-mu-type? %eax 2) # addr => eax + (simple-mu-type? %eax 2) # addr => eax 3d/compare-eax-and 0/imm32/false 74/jump-if-= break/disp8 $check-mu-compute-offset-stmt:base-is-addr: (lookup *(ebx+0xc) *(ebx+0x10)) # Type-tree-right Type-tree-right => eax (lookup *(eax+4) *(eax+8)) # Type-tree-left Type-tree-left => eax - (is-simple-mu-type? %eax 3) # array => eax + (simple-mu-type? %eax 3) # array => eax 3d/compare-eax-and 0/imm32/false 0f 84/jump-if-= $check-mu-compute-offset-stmt:error-base-non-array-type/disp32 } # if (base-type->left == addr) base-type = base-type->right { (lookup *(ebx+4) *(ebx+8)) # Type-tree-left Type-tree-left => eax - (is-simple-mu-type? %eax 2) # addr => eax + (simple-mu-type? %eax 2) # addr => eax 3d/compare-eax-and 0/imm32/false 74/jump-if-= break/disp8 (lookup *(ebx+0xc) *(ebx+0x10)) # Type-tree-right Type-tree-right => eax @@ -24720,10 +24720,10 @@ $check-mu-compute-offset-stmt:check-single-inout: 0f 84/jump-if-= $check-mu-compute-offset-stmt:error-invalid-index-type/disp32 { $check-mu-compute-offset-stmt:index-type-is-atom: - (is-simple-mu-type? %edx 0) # literal => eax + (simple-mu-type? %edx 0) # literal => eax 3d/compare-eax-and 0/imm32/false 75/jump-if-!= break/disp8 - (is-simple-mu-type? %edx 1) # int => eax + (simple-mu-type? %edx 1) # int => eax 3d/compare-eax-and 0/imm32/false 75/jump-if-!= break/disp8 e9/jump $check-mu-compute-offset-stmt:error-invalid-index-type/disp32 @@ -24749,7 +24749,7 @@ $check-mu-compute-offset-stmt:index-type-is-atom: 0f 85/jump-if-!= $check-mu-compute-offset-stmt:error-output-type-not-offset/disp32 # type must start with (offset ...) (lookup *(edx+4) *(edx+8)) # Type-tree-left Type-tree-left => eax - (is-simple-mu-type? %eax 7) # offset => eax + (simple-mu-type? %eax 7) # offset => eax 3d/compare-eax-and 0/imm32/false 0f 84/jump-if-= $check-mu-compute-offset-stmt:error-output-type-not-offset/disp32 # if tail(base-type) != tail(output-type) abort @@ -24976,7 +24976,7 @@ $check-mu-copy-object-stmt:types: 89/<- %ecx 0/r32/eax } # if src-type is not addr, abort - (is-mu-addr-type? %ecx) # => eax + (mu-addr-type? %ecx) # => eax 3d/compare-eax-and 0/imm32/false 0f 84/jump-if-= $check-mu-copy-object-stmt:error-invalid-types/disp32 # var dest-type/ebx: (addr type-tree) = dest->value->type @@ -25092,7 +25092,7 @@ $check-mu-clear-object-stmt:types: 89/<- %ecx 0/r32/eax } # if src-type is not addr, abort - (is-mu-addr-type? %ecx) # => eax + (mu-addr-type? %ecx) # => eax 3d/compare-eax-and 0/imm32/false 0f 84/jump-if-= $check-mu-clear-object-stmt:error-invalid-type/disp32 $check-mu-clear-object-stmt:end: @@ -25184,7 +25184,7 @@ $check-mu-allocate-stmt:check-type: 89/<- %ebx 0/r32/eax } # if target-type is not addr, abort - (is-mu-addr-type? %ebx) # => eax + (mu-addr-type? %ebx) # => eax 3d/compare-eax-and 0/imm32/false 0f 84/jump-if-= $check-mu-allocate-stmt:error-invalid-type/disp32 # if target-type->right is an atom, abort @@ -25193,7 +25193,7 @@ $check-mu-allocate-stmt:check-type: 0f 85/jump-if-!= $check-mu-allocate-stmt:error-invalid-type/disp32 # if target-type->right->left is not handle, abort (lookup *(eax+4) *(eax+8)) # Type-tree-left Type-tree-left => eax - (is-simple-mu-type? %eax 4) # handle => eax + (simple-mu-type? %eax 4) # handle => eax 3d/compare-eax-and 0/imm32/false 0f 84/jump-if-= $check-mu-allocate-stmt:error-invalid-type/disp32 $check-mu-allocate-stmt:end: @@ -25297,7 +25297,7 @@ $check-mu-populate-stmt:check-target-type-deref: } $check-mu-populate-stmt:check-target-type-addr: # if target-type is not addr, abort - (is-mu-addr-type? %ebx) # => eax + (mu-addr-type? %ebx) # => eax 3d/compare-eax-and 0/imm32/false 0f 84/jump-if-= $check-mu-populate-stmt:error-invalid-target-type/disp32 # if target-type->right is an atom, abort @@ -25308,7 +25308,7 @@ $check-mu-populate-stmt:check-target-type-addr: $check-mu-populate-stmt:check-target-type-handle: # if target-type->right->left is not handle, abort (lookup *(ebx+4) *(ebx+8)) # Type-tree-left Type-tree-left => eax - (is-simple-mu-type? %eax 4) # handle => eax + (simple-mu-type? %eax 4) # handle => eax 3d/compare-eax-and 0/imm32/false 0f 84/jump-if-= $check-mu-populate-stmt:error-invalid-target-type/disp32 # if target-type->right->right is an atom, abort @@ -25319,17 +25319,17 @@ $check-mu-populate-stmt:check-target-type-handle: $check-mu-populate-stmt:check-target-type-array: # if target-type->right->right->left is not array, abort (lookup *(ebx+4) *(ebx+8)) # Type-tree-left Type-tree-left => eax - (is-simple-mu-type? %eax 3) # array => eax + (simple-mu-type? %eax 3) # array => eax 3d/compare-eax-and 0/imm32/false 0f 84/jump-if-= $check-mu-populate-stmt:error-invalid-target-type/disp32 $check-mu-populate-stmt:check-length-type: (lookup *esi *(esi+4)) # Stmt-var-value Stmt-var-value => eax (lookup *(eax+8) *(eax+0xc)) # Var-type Var-type => eax 89/<- %ebx 0/r32/eax - (is-simple-mu-type? %ebx 0) # literal => eax + (simple-mu-type? %ebx 0) # literal => eax 3d/compare-eax-and 0/imm32/false 75/jump-if-!= $check-mu-populate-stmt:end/disp8 - (is-simple-mu-type? %ebx 1) # int => eax + (simple-mu-type? %ebx 1) # int => eax 3d/compare-eax-and 0/imm32/false 0f 84/jump-if-= $check-mu-populate-stmt:error-invalid-length-type/disp32 $check-mu-populate-stmt:end: @@ -25447,7 +25447,7 @@ $check-mu-populate-stream-stmt:check-target-type-deref: } $check-mu-populate-stream-stmt:check-target-type-addr: # if target-type is not addr, abort - (is-mu-addr-type? %ebx) # => eax + (mu-addr-type? %ebx) # => eax 3d/compare-eax-and 0/imm32/false 0f 84/jump-if-= $check-mu-populate-stream-stmt:error-invalid-target-type/disp32 # if target-type->right is an atom, abort @@ -25458,7 +25458,7 @@ $check-mu-populate-stream-stmt:check-target-type-addr: $check-mu-populate-stream-stmt:check-target-type-handle: # if target-type->right->left is not handle, abort (lookup *(ebx+4) *(ebx+8)) # Type-tree-left Type-tree-left => eax - (is-simple-mu-type? %eax 4) # handle => eax + (simple-mu-type? %eax 4) # handle => eax 3d/compare-eax-and 0/imm32/false 0f 84/jump-if-= $check-mu-populate-stream-stmt:error-invalid-target-type/disp32 # if target-type->right->right is an atom, abort @@ -25469,17 +25469,17 @@ $check-mu-populate-stream-stmt:check-target-type-handle: $check-mu-populate-stream-stmt:check-target-type-stream: # if target-type->right->right->left is not stream, abort (lookup *(ebx+4) *(ebx+8)) # Type-tree-left Type-tree-left => eax - (is-simple-mu-type? %eax 0xb) # stream => eax + (simple-mu-type? %eax 0xb) # stream => eax 3d/compare-eax-and 0/imm32/false 0f 84/jump-if-= $check-mu-populate-stream-stmt:error-invalid-target-type/disp32 $check-mu-populate-stream-stmt:check-length-type: (lookup *esi *(esi+4)) # Stmt-var-value Stmt-var-value => eax (lookup *(eax+8) *(eax+0xc)) # Var-type Var-type => eax 89/<- %ebx 0/r32/eax - (is-simple-mu-type? %ebx 0) # literal => eax + (simple-mu-type? %ebx 0) # literal => eax 3d/compare-eax-and 0/imm32/false 75/jump-if-!= $check-mu-populate-stream-stmt:end/disp8 - (is-simple-mu-type? %ebx 1) # int => eax + (simple-mu-type? %ebx 1) # int => eax 3d/compare-eax-and 0/imm32/false 0f 84/jump-if-= $check-mu-populate-stream-stmt:error-invalid-length-type/disp32 $check-mu-populate-stream-stmt:end: @@ -25573,7 +25573,7 @@ $check-mu-read-from-stream-stmt:check-base-is-compound: $check-mu-read-from-stream-stmt:check-base-is-addr: # if type->left not addr, abort (lookup *(ebx+4) *(ebx+8)) # Type-tree-left Type-tree-left => eax - (is-simple-mu-type? %eax 2) # addr => eax + (simple-mu-type? %eax 2) # addr => eax 3d/compare-eax-and 0/imm32/false 0f 84/jump-if-= $check-mu-read-from-stream-stmt:error-invalid-base-type/disp32 $check-mu-read-from-stream-stmt:check-base-is-addr-to-stream: @@ -25582,7 +25582,7 @@ $check-mu-read-from-stream-stmt:check-base-is-addr-to-stream: 89/<- %ebx 0/r32/eax # ensure base-type->left == stream (lookup *(eax+4) *(eax+8)) # Type-tree-left Type-tree-left => eax - (is-simple-mu-type? %eax 0xb) # stream => eax + (simple-mu-type? %eax 0xb) # stream => eax 3d/compare-eax-and 0/imm32/false 0f 84/jump-if-= $check-mu-read-from-stream-stmt:error-invalid-base-type/disp32 # - check target type is (addr T) @@ -25604,7 +25604,7 @@ $check-mu-read-from-stream-stmt:check-target-is-compound: $check-mu-read-from-stream-stmt:check-target-type: # target type must start with (addr ...) (lookup *(edx+4) *(edx+8)) # Type-tree-left Type-tree-left => eax - (is-simple-mu-type? %eax 2) # addr => eax + (simple-mu-type? %eax 2) # addr => eax 3d/compare-eax-and 0/imm32/false 0f 84/jump-if-= $check-mu-read-from-stream-stmt:error-target-type-not-address/disp32 # if tail(base-type) != tail(target-type) abort @@ -25740,7 +25740,7 @@ $check-mu-write-to-stream-stmt:check-base-is-compound: $check-mu-write-to-stream-stmt:check-base-is-addr: # if type->left not addr, abort (lookup *(ebx+4) *(ebx+8)) # Type-tree-left Type-tree-left => eax - (is-simple-mu-type? %eax 2) # addr => eax + (simple-mu-type? %eax 2) # addr => eax 3d/compare-eax-and 0/imm32/false 0f 84/jump-if-= $check-mu-write-to-stream-stmt:error-invalid-base-type/disp32 $check-mu-write-to-stream-stmt:check-base-is-addr-to-stream: @@ -25749,7 +25749,7 @@ $check-mu-write-to-stream-stmt:check-base-is-addr-to-stream: 89/<- %ebx 0/r32/eax # ensure base-type->left == stream (lookup *(eax+4) *(eax+8)) # Type-tree-left Type-tree-left => eax - (is-simple-mu-type? %eax 0xb) # stream => eax + (simple-mu-type? %eax 0xb) # stream => eax 3d/compare-eax-and 0/imm32/false 0f 84/jump-if-= $check-mu-write-to-stream-stmt:error-invalid-base-type/disp32 # - check target type is (addr T) @@ -25771,7 +25771,7 @@ $check-mu-write-to-stream-stmt:check-target-is-compound: $check-mu-write-to-stream-stmt:check-target-type: # target type must start with (addr ...) (lookup *(edx+4) *(edx+8)) # Type-tree-left Type-tree-left => eax - (is-simple-mu-type? %eax 2) # addr => eax + (simple-mu-type? %eax 2) # addr => eax 3d/compare-eax-and 0/imm32/false 0f 84/jump-if-= $check-mu-write-to-stream-stmt:error-target-type-not-address/disp32 # if tail(base-type) != tail(target-type) abort @@ -25930,10 +25930,10 @@ $check-mu-convert-stmt:types: } # if input is not int or float, abort { - (is-simple-mu-type? %ecx 1) # int => eax + (simple-mu-type? %ecx 1) # int => eax 3d/compare-eax-and 0/imm32/false 75/jump-if-!= break/disp8 - (is-simple-mu-type? %ecx 0xf) # float => eax + (simple-mu-type? %ecx 0xf) # float => eax 3d/compare-eax-and 0/imm32/false 75/jump-if-!= break/disp8 e9/jump $check-mu-convert-stmt:error-invalid-inout-type/disp32 @@ -25949,30 +25949,30 @@ $check-mu-convert-stmt:types: 89/<- %edx 0/r32/eax # if output is not int or float, abort { - (is-simple-mu-type? %edx 1) # int => eax + (simple-mu-type? %edx 1) # int => eax 3d/compare-eax-and 0/imm32/false 75/jump-if-!= break/disp8 - (is-simple-mu-type? %edx 0xf) # float => eax + (simple-mu-type? %edx 0xf) # float => eax 3d/compare-eax-and 0/imm32/false 75/jump-if-!= break/disp8 e9/jump $check-mu-convert-stmt:error-invalid-output-type/disp32 } # if both are ints, abort { - (is-simple-mu-type? %edx 1) # int => eax + (simple-mu-type? %edx 1) # int => eax 3d/compare-eax-and 0/imm32/false 74/jump-if-= break/disp8 - (is-simple-mu-type? %ecx 1) # int => eax + (simple-mu-type? %ecx 1) # int => eax 3d/compare-eax-and 0/imm32/false 74/jump-if-= break/disp8 e9/jump $check-mu-convert-stmt:error-int-to-int/disp32 } # if both are floats, abort { - (is-simple-mu-type? %edx 0xf) # float => eax + (simple-mu-type? %edx 0xf) # float => eax 3d/compare-eax-and 0/imm32/false 74/jump-if-= break/disp8 - (is-simple-mu-type? %ecx 0xf) # float => eax + (simple-mu-type? %ecx 0xf) # float => eax 3d/compare-eax-and 0/imm32/false 74/jump-if-= break/disp8 e9/jump $check-mu-convert-stmt:error-float-to-float/disp32 @@ -26396,10 +26396,10 @@ type-match?: # def: (addr type-tree), call: (addr type-tree), type-parameters: # if (call is literal and def is numberlike) return true { $type-match?:check-literal-int: - (is-simple-mu-type? *(ebp+0xc) 0) # literal => eax + (simple-mu-type? *(ebp+0xc) 0) # literal => eax 3d/compare-eax-and 0/imm32/false 74/jump-if-= break/disp8 - (is-mu-numberlike-output? *(ebp+8)) # => eax + (mu-numberlike-output? *(ebp+8)) # => eax 3d/compare-eax-and 0/imm32/false 74/jump-if-= break/disp8 b8/copy-to-eax 1/imm32/true @@ -26408,10 +26408,10 @@ $type-match?:check-literal-int: # if (call is literal-string and def is string) return true { $type-match?:check-literal-string: - (is-simple-mu-type? *(ebp+0xc) 0x10) # literal-string => eax + (simple-mu-type? *(ebp+0xc) 0x10) # literal-string => eax 3d/compare-eax-and 0/imm32/false 74/jump-if-= break/disp8 - (is-mu-string-type? *(ebp+8)) # => eax + (mu-string-type? *(ebp+8)) # => eax 3d/compare-eax-and 0/imm32/false 74/jump-if-= break/disp8 b8/copy-to-eax 1/imm32/true @@ -26565,17 +26565,17 @@ size-of: # v: (addr var) -> result/eax: int #? (flush Stderr) (lookup *(ecx+8) *(ecx+0xc)) # Var-type Var-type => eax 89/<- %ecx 0/r32/eax - # if is-mu-array?(t) return size-of-array(t) + # if mu-array?(t) return size-of-array(t) { - (is-mu-array? %ecx) # => eax + (mu-array? %ecx) # => eax 3d/compare-eax-and 0/imm32/false 74/jump-if-= break/disp8 (size-of-array %ecx) # => eax eb/jump $size-of:end/disp8 } - # if is-mu-stream?(t) return size-of-stream(t) + # if mu-stream?(t) return size-of-stream(t) { - (is-mu-stream? %ecx) # => eax + (mu-stream? %ecx) # => eax 3d/compare-eax-and 0/imm32/false 74/jump-if-= break/disp8 (size-of-stream %ecx) # => eax @@ -26612,17 +26612,17 @@ size-of-deref: # v: (addr var) -> result/eax: int # t = lookup(t->right) (lookup *(ecx+0xc) *(ecx+0x10)) # Type-tree-right Type-tree-right => eax 89/<- %ecx 0/r32/eax - # if is-mu-array?(t) return size-of-array(t) + # if mu-array?(t) return size-of-array(t) { - (is-mu-array? %ecx) # => eax + (mu-array? %ecx) # => eax 3d/compare-eax-and 0/imm32/false 74/jump-if-= break/disp8 (size-of-array %ecx) # => eax eb/jump $size-of-deref:end/disp8 } - # if is-mu-stream?(t) return size-of-stream(t) + # if mu-stream?(t) return size-of-stream(t) { - (is-mu-stream? %ecx) # => eax + (mu-stream? %ecx) # => eax 3d/compare-eax-and 0/imm32/false 74/jump-if-= break/disp8 (size-of-stream %ecx) # => eax @@ -26645,7 +26645,7 @@ $size-of-deref:end: 5d/pop-to-ebp c3/return -is-mu-array?: # t: (addr type-tree) -> result/eax: boolean +mu-array?: # t: (addr type-tree) -> result/eax: boolean # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp @@ -26655,19 +26655,19 @@ is-mu-array?: # t: (addr type-tree) -> result/eax: boolean 8b/-> *(ebp+8) 1/r32/ecx # if t->is-atom?, return false 81 7/subop/compare *ecx 0/imm32/false # Type-tree-is-atom - 75/jump-if-!= $is-mu-array?:return-false/disp8 + 75/jump-if-!= $mu-array?:return-false/disp8 # if !t->left->is-atom?, return false (lookup *(ecx+4) *(ecx+8)) # Type-tree-left Type-tree-left => eax 81 7/subop/compare *eax 0/imm32/false # Type-tree-is-atom - 74/jump-if-= $is-mu-array?:return-false/disp8 + 74/jump-if-= $mu-array?:return-false/disp8 # return t->left->value == array 81 7/subop/compare *(eax+4) 3/imm32/array-type-id # Type-tree-value 0f 94/set-if-= %al 81 4/subop/and %eax 0xff/imm32 - eb/jump $is-mu-array?:end/disp8 -$is-mu-array?:return-false: + eb/jump $mu-array?:end/disp8 +$mu-array?:return-false: b8/copy-to-eax 0/imm32/false -$is-mu-array?:end: +$mu-array?:end: # . restore registers 59/pop-to-ecx # . epilogue @@ -26710,7 +26710,7 @@ $size-of-array:end: 5d/pop-to-ebp c3/return -is-mu-stream?: # t: (addr type-tree) -> result/eax: boolean +mu-stream?: # t: (addr type-tree) -> result/eax: boolean # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp @@ -26720,19 +26720,19 @@ is-mu-stream?: # t: (addr type-tree) -> result/eax: boolean 8b/-> *(ebp+8) 1/r32/ecx # if t->is-atom?, return false 81 7/subop/compare *ecx 0/imm32/false # Type-tree-is-atom - 75/jump-if-!= $is-mu-stream?:return-false/disp8 + 75/jump-if-!= $mu-stream?:return-false/disp8 # if !t->left->is-atom?, return false (lookup *(ecx+4) *(ecx+8)) # Type-tree-left Type-tree-left => eax 81 7/subop/compare *eax 0/imm32/false # Type-tree-is-atom - 74/jump-if-= $is-mu-stream?:return-false/disp8 + 74/jump-if-= $mu-stream?:return-false/disp8 # return t->left->value == stream 81 7/subop/compare *(eax+4) 0xb/imm32/stream-type-id # Type-tree-value 0f 94/set-if-= %al 81 4/subop/and %eax 0xff/imm32 - eb/jump $is-mu-stream?:end/disp8 -$is-mu-stream?:return-false: + eb/jump $mu-stream?:end/disp8 +$mu-stream?:return-false: b8/copy-to-eax 0/imm32/false -$is-mu-stream?:end: +$mu-stream?:end: # . restore registers 59/pop-to-ecx # . epilogue @@ -26852,7 +26852,7 @@ $type-tail:check-array-capacity-1: 3d/compare-eax-and 0/imm32 74/jump-if-= break/disp8 $type-tail:check-array-capacity-2: - (is-simple-mu-type? %eax 9) # array-capacity => eax + (simple-mu-type? %eax 9) # array-capacity => eax 3d/compare-eax-and 0/imm32/false 74/jump-if-= break/disp8 $type-tail:array-capacity: @@ -27118,7 +27118,7 @@ $emit-subx-stmt-list:check-for-stmt: 0f 85/jump-if-!= break/disp32 $emit-subx-stmt-list:stmt1: { - (is-mu-branch? %ecx) # => eax + (mu-branch? %ecx) # => eax 3d/compare-eax-and 0/imm32/false 0f 84/jump-if-= break/disp32 $emit-subx-stmt-list:branch-stmt: @@ -27478,7 +27478,7 @@ emit-int-output: # out: (addr buffered-file), return-var: (addr stmt-var), dest 89/<- %ecx 0/r32/eax # if curr-var is a literal, emit copy of a literal to the output (lookup *(ecx+8) *(ecx+0xc)) # Var-type Var-type => eax - (is-simple-mu-type? %eax 0) # literal => eax + (simple-mu-type? %eax 0) # literal => eax { 3d/compare-eax-and 0/imm32/false 0f 84/jump-if-= break/disp32 @@ -27530,7 +27530,7 @@ $emit-float-output:end: 5d/pop-to-ebp c3/return -is-mu-branch?: # stmt: (addr stmt1) -> result/eax: boolean +mu-branch?: # stmt: (addr stmt1) -> result/eax: boolean # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp @@ -27543,14 +27543,14 @@ is-mu-branch?: # stmt: (addr stmt1) -> result/eax: boolean # if (stmt->operation starts with "loop") return true (string-starts-with? %ecx "loop") # => eax 3d/compare-eax-and 0/imm32/false - 75/jump-if-not-equal $is-mu-branch?:end/disp8 + 75/jump-if-not-equal $mu-branch?:end/disp8 # if (stmt->operation starts with "break") return true (string-starts-with? %ecx "break") # => eax 3d/compare-eax-and 0/imm32/false - 75/jump-if-not-equal $is-mu-branch?:end/disp8 + 75/jump-if-not-equal $mu-branch?:end/disp8 # otherwise return (stmt->operation starts with "return") (string-starts-with? %ecx "return") # => eax -$is-mu-branch?:end: +$mu-branch?:end: # . restore registers 59/pop-to-ecx # . epilogue @@ -28513,7 +28513,7 @@ emit-subx-var-def: # out: (addr buffered-file), stmt: (addr stmt) # if v is an array, do something special to initialize it { (lookup *(ecx+8) *(ecx+0xc)) # Var-type Var-type => eax - (is-mu-array? %eax) # => eax + (mu-array? %eax) # => eax 3d/compare-eax-and 0/imm32/false 0f 84/jump-if-= break/disp32 # var array-size-without-size/edx: int = n-4 @@ -28526,7 +28526,7 @@ emit-subx-var-def: # out: (addr buffered-file), stmt: (addr stmt) # a stream is an array with 2 extra pointers { (lookup *(ecx+8) *(ecx+0xc)) # Var-type Var-type => eax - (is-mu-stream? %eax) # => eax + (mu-stream? %eax) # => eax 3d/compare-eax-and 0/imm32/false 0f 84/jump-if-= break/disp32 # var array-size-without-size/edx: int = n-12 @@ -28703,7 +28703,7 @@ emit-subx-stmt: # out: (addr buffered-file), stmt: (addr stmt), primitives: (ad } # - optimizations # if copy instruction has same register in source and destination, emit nothing - (is-redundant-copy? *(ebp+0xc)) # => eax + (redundant-copy? *(ebp+0xc)) # => eax 3d/compare-eax-and 0/imm32/false 75/jump-if-!= $emit-subx-stmt:end/disp8 # - if stmt matches a primitive, emit it @@ -28730,7 +28730,7 @@ $emit-subx-stmt:end: 5d/pop-to-ebp c3/return -is-redundant-copy?: # stmt: (addr stmt) -> result/eax: boolean +redundant-copy?: # stmt: (addr stmt) -> result/eax: boolean # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp @@ -28743,14 +28743,14 @@ is-redundant-copy?: # stmt: (addr stmt) -> result/eax: boolean (lookup *(esi+4) *(esi+8)) # Stmt1-operation Stmt1-operation => eax (string-equal? %eax "copy") # => eax 3d/compare-eax-and 0/imm32/false - 0f 84/jump-if-= $is-redundant-copy?:end/disp32 + 0f 84/jump-if-= $redundant-copy?:end/disp32 # var output-reg/edi: (addr stmt-var) = stmt->outputs->value->register (lookup *(esi+0x14) *(esi+0x18)) # Stmt1-outputs Stmt1-outputs => eax (lookup *eax *(eax+4)) # Stmt-var-value Stmt-var-value => eax (lookup *(eax+0x18) *(eax+0x1c)) # Var-register Var-register => eax # . if output-reg == null, return false 3d/compare-eax-and 0/imm32 - 74/jump-if-= $is-redundant-copy?:end/disp8 + 74/jump-if-= $redundant-copy?:end/disp8 89/<- %edi 0/r32/eax # return (inout->value->register == output->value->register) (lookup *(esi+0xc) *(esi+0x10)) # Stmt1-inouts Stmt1-inouts => eax @@ -28759,15 +28759,15 @@ is-redundant-copy?: # stmt: (addr stmt) -> result/eax: boolean { 74/jump-if-= break/disp8 b8/copy-to-eax 0/imm32/false - e9/jump $is-redundant-copy?:end/disp32 + e9/jump $redundant-copy?:end/disp32 } (lookup *eax *(eax+4)) # Stmt-var-value Stmt-var-value => eax (lookup *(eax+0x18) *(eax+0x1c)) # Var-register Var-register => eax # . if inout-reg == null, return false 3d/compare-eax-and 0/imm32 - 74/jump-if-= $is-redundant-copy?:end/disp8 + 74/jump-if-= $redundant-copy?:end/disp8 (string-equal? %eax %edi) # => eax -$is-redundant-copy?:end: +$redundant-copy?:end: # . restore registers 5f/pop-to-edi 5e/pop-to-esi @@ -28929,7 +28929,7 @@ array-element-type-id: # v: (addr var), err: (addr buffered-file), ed: (addr ex { 50/push-eax (lookup *(eax+4) *(eax+8)) # Type-tree-left Type-tree-left => eax - (is-simple-mu-type? %eax 2) # addr => eax + (simple-mu-type? %eax 2) # addr => eax 3d/compare-eax-with 0/imm32/false 58/pop-to-eax 74/jump-if-= break/disp8 @@ -28946,7 +28946,7 @@ $array-element-type-id:skip-addr: { 50/push-eax (lookup *(eax+4) *(eax+8)) # Type-tree-left Type-tree-left => eax - (is-simple-mu-type? %eax 3) # array => eax + (simple-mu-type? %eax 3) # array => eax 3d/compare-eax-with 0/imm32/false 58/pop-to-eax $array-element-type-id:no-array: @@ -29232,7 +29232,7 @@ $emit-mu-index-bounds-check:emit-register-index: # otherwise if index is a literal, print it $emit-mu-index-bounds-check:emit-literal-index: (lookup *(edx+8) *(edx+0xc)) # Var-type Var-type => eax - (is-simple-mu-type? %eax 0) # => eax + (simple-mu-type? %eax 0) # => eax 3d/compare-eax-and 0/imm32/false { 0f 84/jump-if-= break/disp32 @@ -29246,11 +29246,11 @@ $emit-mu-index-bounds-check:emit-element-size: { { (lookup *(edx+8) *(edx+0xc)) # Var-type Var-type => eax - (is-simple-mu-type? %eax 0) # literal => eax + (simple-mu-type? %eax 0) # literal => eax 3d/compare-eax-and 0/imm32/false 75/jump-if-!= break/disp8 (lookup *(edx+8) *(edx+0xc)) # Var-type Var-type => eax - (is-simple-mu-type? %eax 1) # int => eax + (simple-mu-type? %eax 1) # int => eax 3d/compare-eax-and 0/imm32/false 75/jump-if-!= break/disp8 eb/jump $emit-mu-index-bounds-check:emit-element-size-offset/disp8 @@ -29267,7 +29267,7 @@ $emit-mu-index-bounds-check:emit-element-size-offset: { 75/jump-if-!= break/disp8 (lookup *(eax+4) *(eax+8)) # Type-tree-left Type-tree-left => eax - (is-simple-mu-type? %eax 7) # => eax + (simple-mu-type? %eax 7) # => eax 3d/compare-eax-and 0/imm32/false { 0f 84/jump-if-= break/disp32 @@ -29349,7 +29349,7 @@ $translate-mu-index-stmt-with-array-in-register:emit-base: $translate-mu-index-stmt-with-array-in-register:emit-register-index: # if index is an int (lookup *(edx+8) *(edx+0xc)) # Var-type Var-type => eax - (is-simple-mu-type? %eax 1) # int => eax + (simple-mu-type? %eax 1) # int => eax 3d/compare-eax-and 0/imm32/false { 0f 84/jump-if-= break/disp32 @@ -29372,7 +29372,7 @@ $translate-mu-index-stmt-with-array-in-register:emit-int-register-index: 0f 85/jump-if-!= $translate-mu-index-stmt:error2/disp32 # if index has type (offset ...) (lookup *(eax+4) *(eax+8)) # Type-tree-left Type-tree-left => eax - (is-simple-mu-type? %eax 7) # => eax + (simple-mu-type? %eax 7) # => eax 3d/compare-eax-and 0/imm32/false { 0f 84/jump-if-= break/disp32 @@ -29387,7 +29387,7 @@ $translate-mu-index-stmt-with-array-in-register:emit-register-index-done: } # otherwise if index is a literal (lookup *(edx+8) *(edx+0xc)) # Var-type Var-type => eax - (is-simple-mu-type? %eax 0) # => eax + (simple-mu-type? %eax 0) # => eax 3d/compare-eax-and 0/imm32/false { 0f 84/jump-if-= break/disp32 @@ -29460,7 +29460,7 @@ translate-mu-index-stmt-with-array-on-stack: # out: (addr buffered-file), stmt: $translate-mu-index-stmt-with-array-on-stack:emit-register-index: # if index is an int (lookup *(edx+8) *(edx+0xc)) # Var-type Var-type => eax - (is-simple-mu-type? %eax 1) # int => eax + (simple-mu-type? %eax 1) # int => eax 3d/compare-eax-and 0/imm32/false { 0f 84/jump-if-= break/disp32 @@ -29489,7 +29489,7 @@ $translate-mu-index-stmt-with-array-on-stack:emit-int-register-index: 0f 85/jump-if-!= $translate-mu-index-stmt:error2/disp32 # if index has type (offset ...) (lookup *(eax+4) *(eax+8)) # Type-tree-left Type-tree-left => eax - (is-simple-mu-type? %eax 7) # => eax + (simple-mu-type? %eax 7) # => eax 3d/compare-eax-and 0/imm32/false { 0f 84/jump-if-= break/disp32 @@ -29504,7 +29504,7 @@ $translate-mu-index-stmt-with-array-on-stack:emit-register-index-done: } # otherwise if index is a literal (lookup *(edx+8) *(edx+0xc)) # Var-type Var-type => eax - (is-simple-mu-type? %eax 0) # => eax + (simple-mu-type? %eax 0) # => eax 3d/compare-eax-and 0/imm32/false { 0f 84/jump-if-= break/disp32 @@ -35726,11 +35726,11 @@ type-category: # a: (addr type-tree) -> result/eax: int 89/<- %ebp 4/r32/esp # . save registers 51/push-ecx - # var lit?/ecx: boolean = is-literal-type?(a) - (is-simple-mu-type? *(ebp+8) 0) # literal => eax + # var lit?/ecx: boolean = literal-type?(a) + (simple-mu-type? *(ebp+8) 0) # literal => eax 89/<- %ecx 0/r32/eax - # var float?/eax: int = is-float?(a) - (is-simple-mu-type? *(ebp+8) 0xf) # => eax + # var float?/eax: int = float?(a) + (simple-mu-type? *(ebp+8) 0xf) # => eax # set bits for lit? and float? c1/shift 4/subop/left %ecx 1/imm8 09/or %eax 1/r32/ecx @@ -35742,7 +35742,7 @@ $type-category:end: 5d/pop-to-ebp c3/return -is-simple-mu-type?: # a: (addr type-tree), n: type-id -> result/eax: boolean +simple-mu-type?: # a: (addr type-tree), n: type-id -> result/eax: boolean # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp @@ -35755,7 +35755,7 @@ is-simple-mu-type?: # a: (addr type-tree), n: type-id -> result/eax: boolean 39/compare *(eax+4) 1/r32/ecx # Type-tree-value 0f 94/set-byte-if-= %al 81 4/subop/and %eax 0xff/imm32 -$is-simple-mu-type?:end: +$simple-mu-type?:end: # . restore registers 59/pop-to-ecx # . epilogue @@ -35763,7 +35763,7 @@ $is-simple-mu-type?:end: 5d/pop-to-ebp c3/return -is-mu-addr-type?: # a: (addr type-tree) -> result/eax: boolean +mu-addr-type?: # a: (addr type-tree) -> result/eax: boolean # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp @@ -35779,13 +35779,13 @@ is-mu-addr-type?: # a: (addr type-tree) -> result/eax: boolean 81 7/subop/compare *(eax+4) 2/imm32/addr # Type-tree-value 0f 94/set-byte-if-= %al 81 4/subop/and %eax 0xff/imm32 -$is-mu-addr-type?:end: +$mu-addr-type?:end: # . epilogue 89/<- %esp 5/r32/ebp 5d/pop-to-ebp c3/return -is-mu-array-type?: # a: (addr type-tree) -> result/eax: boolean +mu-array-type?: # a: (addr type-tree) -> result/eax: boolean # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp @@ -35801,13 +35801,13 @@ is-mu-array-type?: # a: (addr type-tree) -> result/eax: boolean 81 7/subop/compare *(eax+4) 3/imm32/array # Type-tree-value 0f 94/set-byte-if-= %al 81 4/subop/and %eax 0xff/imm32 -$is-mu-array-type?:end: +$mu-array-type?:end: # . epilogue 89/<- %esp 5/r32/ebp 5d/pop-to-ebp c3/return -is-mu-string-type?: # a: (addr type-tree) -> result/eax: boolean +mu-string-type?: # a: (addr type-tree) -> result/eax: boolean # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp @@ -35817,29 +35817,29 @@ is-mu-string-type?: # a: (addr type-tree) -> result/eax: boolean 8b/-> *(ebp+8) 6/r32/esi # if (a->is-atom?) return false 81 7/subop/compare *esi 0/imm32/false # Type-tree-is-atom - 0f 85/jump-if-!= $is-mu-string-type?:return-false/disp32 + 0f 85/jump-if-!= $mu-string-type?:return-false/disp32 # if a is not an addr, return false - (is-mu-addr-type? %esi) # => eax + (mu-addr-type? %esi) # => eax 3d/compare-eax-with 0/imm32/false - 0f 84/jump-if-= $is-mu-string-type?:end/disp32 # eax changes var + 0f 84/jump-if-= $mu-string-type?:end/disp32 # eax changes var # if a is not an array, return false (lookup *(esi+0xc) *(esi+0x10)) # Type-tree-right Type-tree-right => eax - (is-mu-array-type? %eax) # => eax + (mu-array-type? %eax) # => eax 3d/compare-eax-with 0/imm32/false - 74/jump-if-= $is-mu-string-type?:end/disp8 # eax changes var + 74/jump-if-= $mu-string-type?:end/disp8 # eax changes var # var p/eax: (addr type-tree) = payload of a (lookup *(esi+0xc) *(esi+0x10)) # Type-tree-right Type-tree-right => eax (lookup *(eax+0xc) *(eax+0x10)) # Type-tree-right Type-tree-right => eax # if p is an atom, return false 81 7/subop/compare *eax 0/imm32/false # Type-tree-is-atom - 75/jump-if-!= $is-mu-string-type?:return-false/disp8 + 75/jump-if-!= $mu-string-type?:return-false/disp8 # return (p == byte) (lookup *(eax+4) *(eax+8)) # Type-tree-left Type-tree-left => eax - (is-simple-mu-type? %eax 8) # byte => eax - eb/jump $is-mu-string-type?:end/disp8 -$is-mu-string-type?:return-false: + (simple-mu-type? %eax 8) # byte => eax + eb/jump $mu-string-type?:end/disp8 +$mu-string-type?:return-false: b8/copy-to-eax 0/imm32/false -$is-mu-string-type?:end: +$mu-string-type?:end: # . restore registers 5e/pop-to-esi # . epilogue @@ -35847,7 +35847,7 @@ $is-mu-string-type?:end: 5d/pop-to-ebp c3/return -is-mu-stream-type?: # a: (addr type-tree) -> result/eax: boolean +mu-stream-type?: # a: (addr type-tree) -> result/eax: boolean # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp @@ -35863,7 +35863,7 @@ is-mu-stream-type?: # a: (addr type-tree) -> result/eax: boolean 81 7/subop/compare *(eax+4) 0xb/imm32/stream # Type-tree-value 0f 94/set-byte-if-= %al 81 4/subop/and %eax 0xff/imm32 -$is-mu-stream-type?:end: +$mu-stream-type?:end: # . epilogue 89/<- %esp 5/r32/ebp 5d/pop-to-ebp diff --git a/linux/pack b/linux/pack index 8e025a8f..c46ca06b 100755 Binary files a/linux/pack and b/linux/pack differ diff --git a/linux/rpn.mu b/linux/rpn.mu index 9b290d28..f849e05d 100644 --- a/linux/rpn.mu +++ b/linux/rpn.mu @@ -69,8 +69,8 @@ fn simplify in: (addr stream byte) -> _/eax: int { break-if-!= # if word is an operator, perform it { - var is-add?/eax: boolean <- slice-equal? word, "+" - compare is-add?, 0 + var add?/eax: boolean <- slice-equal? word, "+" + compare add?, 0 break-if-= var _b/eax: int <- pop-int-stack stack var b/edx: int <- copy _b @@ -80,8 +80,8 @@ fn simplify in: (addr stream byte) -> _/eax: int { loop $simplify:word-loop } { - var is-sub?/eax: boolean <- slice-equal? word, "-" - compare is-sub?, 0 + var sub?/eax: boolean <- slice-equal? word, "-" + compare sub?, 0 break-if-= var _b/eax: int <- pop-int-stack stack var b/edx: int <- copy _b @@ -91,8 +91,8 @@ fn simplify in: (addr stream byte) -> _/eax: int { loop $simplify:word-loop } { - var is-mul?/eax: boolean <- slice-equal? word, "*" - compare is-mul?, 0 + var mul?/eax: boolean <- slice-equal? word, "*" + compare mul?, 0 break-if-= var _b/eax: int <- pop-int-stack stack var b/edx: int <- copy _b diff --git a/linux/sigils b/linux/sigils index 42bada3d..88c96e10 100755 Binary files a/linux/sigils and b/linux/sigils differ diff --git a/linux/sigils.subx b/linux/sigils.subx index d980b32f..f6c1c458 100644 --- a/linux/sigils.subx +++ b/linux/sigils.subx @@ -4065,14 +4065,14 @@ $next-hex-int:loop: # if (curr >= in->end) break 39/compare 3/mod/direct 1/rm32/ecx . . . 2/r32/edx . . # compare ecx with edx 73/jump-if-addr>= $next-hex-int:break/disp8 - # if (!is-hex-digit?(*curr)) break + # if (!hex-digit?(*curr)) break # . eax = *curr 8a/copy-byte 0/mod/indirect 1/rm32/ecx . . . 0/r32/AL . . # copy byte at *ecx to AL - # . eax = is-hex-digit?(*curr) + # . eax = hex-digit?(*curr) # . . push args 50/push-eax # . . call - e8/call is-hex-digit?/disp32 + e8/call hex-digit?/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp # . if (eax == false) break @@ -4447,14 +4447,14 @@ $next-positive-hex-int:loop: # if (curr >= in->end) break 39/compare 3/mod/direct 1/rm32/ecx . . . 2/r32/edx . . # compare ecx with edx 73/jump-if-addr>= $next-positive-hex-int:end/disp8 - # if (!is-hex-digit?(*curr)) break + # if (!hex-digit?(*curr)) break # . eax = *curr 8a/copy-byte 0/mod/indirect 1/rm32/ecx . . . 0/r32/AL . . # copy byte at *ecx to AL - # . eax = is-hex-digit?(*curr) + # . eax = hex-digit?(*curr) # . . push args 50/push-eax # . . call - e8/call is-hex-digit?/disp32 + e8/call hex-digit?/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp # . if (eax == false) break diff --git a/linux/survey_baremetal b/linux/survey_baremetal index c11a0169..4467b67a 100755 Binary files a/linux/survey_baremetal and b/linux/survey_baremetal differ diff --git a/linux/survey_baremetal.subx b/linux/survey_baremetal.subx index a37567dc..e4d82bf5 100644 --- a/linux/survey_baremetal.subx +++ b/linux/survey_baremetal.subx @@ -344,7 +344,7 @@ compute-offsets: # in: (addr stream byte), labels: (addr stream {(handle array # break # end of line # else if slice-equal?(word-slice, "==") # no need for segment header # break - # else if is-label?(word-slice) + # else if label?(word-slice) # strip trailing ':' from word-slice # trace("label '" word-slice "' is at address " current-address ".") # # labels occupy no space, so no need to increment offsets @@ -466,12 +466,12 @@ $compute-offsets:case-segment-header: 3d/compare-eax-and 0/imm32/false 0f 85/jump-if-!= $compute-offsets:line-loop/disp32 $compute-offsets:case-label: - # if (!is-label?(word-slice)) goto next case - # . eax = is-label?(word-slice) + # if (!label?(word-slice)) goto next case + # . eax = label?(word-slice) # . . push args 52/push-edx # . . call - e8/call is-label?/disp32 + e8/call label?/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp # . if (eax == false) goto next case @@ -740,7 +740,7 @@ emit-output: # in: (addr stream byte), out: (addr buffered-file), labels: (addr # read-line(in, line) # if (line->write == 0) break # end of file # address-of-next-instruction += num-bytes(line) - # var is-far-jump-or-call? = is-far-jump-or-call?(line) + # var far-jump-or-call? = far-jump-or-call?(line) # rewind-stream(line) # while true # var word-slice = next-word(line) @@ -748,7 +748,7 @@ emit-output: # in: (addr stream byte), out: (addr buffered-file), labels: (addr # break # if slice-starts-with?(word-slice, "#") # comment # break - # if is-label?(word-slice) # no need for label declarations anymore + # if label?(word-slice) # no need for label declarations anymore # goto line-loop # don't insert empty lines # if slice-equal?(word-slice, "==") # no need for segment header lines # goto line-loop # don't insert empty lines @@ -766,7 +766,7 @@ emit-output: # in: (addr stream byte), out: (addr buffered-file), labels: (addr # value = *address - address-of-next-instruction # emit(out, value, 1) # else if has-metadata?(word-slice, "disp32") - # if is-far-jump-or-call? + # if far-jump-or-call? # value = *address - address-of-next-instruction # else # value = *address @@ -779,7 +779,7 @@ emit-output: # in: (addr stream byte), out: (addr buffered-file), labels: (addr # line: ecx # word-slice: edx # address-of-next-instruction: ebx - # is-far-jump-or-call?: edi + # far-jump-or-call?: edi # address: esi (inner loop only) # temporaries: eax, esi (outer loop) # @@ -868,11 +868,11 @@ $emit-output:check-for-end-of-input: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp # . ebx += eax 01/add 3/mod/direct 3/rm32/ebx . . . 0/r32/eax . . # add eax to ebx - # var is-far-jump-or-call?/edi: boolean = is-far-jump-or-call?(line) + # var far-jump-or-call?/edi: boolean = far-jump-or-call?(line) # . . push args 51/push-ecx # . . call - e8/call is-far-jump-or-call?/disp32 + e8/call far-jump-or-call?/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp # rewind-stream(line) @@ -947,12 +947,12 @@ $emit-output:check-for-comment: 3d/compare-eax-and 0x23/imm32/hash 0f 84/jump-if-= $emit-output:next-line/disp32 $emit-output:check-for-label: - # if is-label?(word-slice) break - # . eax = is-label?(word-slice) + # if label?(word-slice) break + # . eax = label?(word-slice) # . . push args 52/push-edx # . . call - e8/call is-label?/disp32 + e8/call label?/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp # . if (eax != false) break @@ -1169,7 +1169,7 @@ $emit-output:check-disp32: $emit-output:emit-disp32: # var value/eax = *address 8b/copy 0/mod/indirect 6/rm32/esi . . . 0/r32/eax . . # copy *esi to eax - # if (is-far-jump-or-call?) value -= address-of-next-instruction + # if (far-jump-or-call?) value -= address-of-next-instruction 81 7/subop/compare 3/mod/direct 7/rm32/edi . . . . . 0/imm32/false # compare edi 74/jump-if-= $emit-output:really-emit-disp32/disp8 29/subtract 3/mod/direct 0/rm32/eax . . . 3/r32/ebx . . # subtract ebx from eax @@ -1851,7 +1851,7 @@ test-emit-output-code-label-absolute: # reads line to make some checks # don't assume the read state of line after calling this function -is-far-jump-or-call?: # line: (addr stream byte) -> result/edi: boolean +far-jump-or-call?: # line: (addr stream byte) -> result/edi: boolean # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -1872,7 +1872,7 @@ is-far-jump-or-call?: # line: (addr stream byte) -> result/edi: boolean 89/copy 3/mod/direct 3/rm32/ebx . . . 4/r32/esp . . # copy esp to ebx # result = false bf/copy-to-edi 0/imm32/false -$is-far-jump-or-call?:check-first-word: +$far-jump-or-call?:check-first-word: # next-word(line, word-slice) # . . push args 52/push-edx @@ -1891,7 +1891,7 @@ $is-far-jump-or-call?:check-first-word: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp # . if (eax != 0) return 3d/compare-eax-and 0/imm32/false - 0f 85/jump-if-!= $is-far-jump-or-call?:end/disp32 + 0f 85/jump-if-!= $far-jump-or-call?:end/disp32 # datum = next-token-from-slice(word-slice->start, word-slice->end, "/") # . . push args 53/push-ebx @@ -1913,7 +1913,7 @@ $is-far-jump-or-call?:check-first-word: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # . if (eax != false) return true 3d/compare-eax-and 0/imm32/false - 75/jump-if-!= $is-far-jump-or-call?:return-true/disp8 + 75/jump-if-!= $far-jump-or-call?:return-true/disp8 # if (datum-slice == "e9") return true # . eax = slice-equal?(datum-slice, "e9") # . . push args @@ -1925,7 +1925,7 @@ $is-far-jump-or-call?:check-first-word: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # . if (eax != false) return true 3d/compare-eax-and 0/imm32/false - 75/jump-if-!= $is-far-jump-or-call?:return-true/disp8 + 75/jump-if-!= $far-jump-or-call?:return-true/disp8 # if (datum-slice != "0f") return false # . eax = slice-equal?(datum-slice, "0f") # . . push args @@ -1937,8 +1937,8 @@ $is-far-jump-or-call?:check-first-word: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # . if (eax == false) return 3d/compare-eax-and 0/imm32/false - 74/jump-if-= $is-far-jump-or-call?:end/disp8 -$is-far-jump-or-call?:check-second-word: + 74/jump-if-= $far-jump-or-call?:end/disp8 +$far-jump-or-call?:check-second-word: # next-word(line, word-slice) # . . push args 52/push-edx @@ -1957,7 +1957,7 @@ $is-far-jump-or-call?:check-second-word: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp # . if (eax != 0) return 3d/compare-eax-and 0/imm32/false - 75/jump-if-!= $is-far-jump-or-call?:end/disp8 + 75/jump-if-!= $far-jump-or-call?:end/disp8 # if datum of word-slice does not start with "8", return false # . start/eax = word-slice->start 8b/copy 0/mod/indirect 2/rm32/edx . . . 0/r32/eax . . # copy *edx to eax @@ -1966,11 +1966,11 @@ $is-far-jump-or-call?:check-second-word: 81 4/subop/and 3/mod/direct 0/rm32/eax . . . . . 0xff/imm32 # bitwise and of eax # . if (eax != '8') return 3d/compare-eax-and 0x38/imm32/8 - 75/jump-if-!= $is-far-jump-or-call?:end/disp8 + 75/jump-if-!= $far-jump-or-call?:end/disp8 # otherwise return true -$is-far-jump-or-call?:return-true: +$far-jump-or-call?:return-true: bf/copy-to-edi 1/imm32/true -$is-far-jump-or-call?:end: +$far-jump-or-call?:end: # . reclaim locals 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32 # add to esp # . restore registers @@ -2187,7 +2187,7 @@ num-bytes: # line: (addr stream byte) -> eax: int # break # if slice-starts-with?(word-slice, "#") # comment # break - # if is-label?(word-slice) # no need for label declarations anymore + # if label?(word-slice) # no need for label declarations anymore # break # if slice-equal?(word-slice, "==") # break # no need for segment header lines diff --git a/linux/survey_elf b/linux/survey_elf index 1a80def5..40315109 100755 Binary files a/linux/survey_elf and b/linux/survey_elf differ diff --git a/linux/survey_elf.subx b/linux/survey_elf.subx index dcaf6bab..15fb2c59 100644 --- a/linux/survey_elf.subx +++ b/linux/survey_elf.subx @@ -449,7 +449,7 @@ compute-offsets: # in: (addr stream byte), segments: (addr stream {(handle arra # trace("segment '", curr-segment-name, "' is at file offset ", sinfo->file-offset) # segment-offset = 0 # break (next line) - # else if is-label?(word-slice) + # else if label?(word-slice) # strip trailing ':' from word-slice # linfo: (addr label-info) = get-or-insert-slice(labels, word-slice) # linfo->segment-name = curr-segment-name @@ -724,12 +724,12 @@ $compute-offsets:update-curr-segment-name: # break e9/jump $compute-offsets:line-loop/disp32 $compute-offsets:case-label: - # if (!is-label?(word-slice)) goto next case - # . eax = is-label?(word-slice) + # if (!label?(word-slice)) goto next case + # . eax = label?(word-slice) # . . push args 52/push-edx # . . call - e8/call is-label?/disp32 + e8/call label?/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp # . if (eax == false) goto next case @@ -1839,7 +1839,7 @@ emit-segments: # in: (addr stream byte), out: (addr buffered-file), labels: (ad # read-line(in, line) # if (line->write == 0) break # end of file # offset-of-next-instruction += num-bytes(line) - # var is-far-jump-or-call? = is-far-jump-or-call?(line) + # var far-jump-or-call? = far-jump-or-call?(line) # rewind-stream(line) # while true # var word-slice = next-word(line) @@ -1847,7 +1847,7 @@ emit-segments: # in: (addr stream byte), out: (addr buffered-file), labels: (ad # break # if slice-starts-with?(word-slice, "#") # comment # break - # if is-label?(word-slice) # no need for label declarations anymore + # if label?(word-slice) # no need for label declarations anymore # goto line-loop # don't insert empty lines # if slice-equal?(word-slice, "==") # no need for segment header lines # goto line-loop # don't insert empty lines @@ -1865,7 +1865,7 @@ emit-segments: # in: (addr stream byte), out: (addr buffered-file), labels: (ad # value = info->offset - offset-of-next-instruction # emit(out, value, 1) # else if has-metadata?(word-slice, "disp32") - # if is-far-jump-or-call? + # if far-jump-or-call? # value = info->offset - offset-of-next-instruction # else # value = info->address @@ -1878,7 +1878,7 @@ emit-segments: # in: (addr stream byte), out: (addr buffered-file), labels: (ad # line: ecx # word-slice: edx # offset-of-next-instruction: ebx - # is-far-jump-or-call?: edi + # far-jump-or-call?: edi # info: esi (inner loop only) # temporaries: eax, esi (outer loop) # @@ -1967,11 +1967,11 @@ $emit-segments:check-for-end-of-input: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp # . ebx += eax 01/add 3/mod/direct 3/rm32/ebx . . . 0/r32/eax . . # add eax to ebx - # var is-far-jump-or-call?/edi: boolean = is-far-jump-or-call?(line) + # var far-jump-or-call?/edi: boolean = far-jump-or-call?(line) # . . push args 51/push-ecx # . . call - e8/call is-far-jump-or-call?/disp32 + e8/call far-jump-or-call?/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp # rewind-stream(line) @@ -2046,12 +2046,12 @@ $emit-segments:check-for-comment: 3d/compare-eax-and 0x23/imm32/hash 0f 84/jump-if-= $emit-segments:next-line/disp32 $emit-segments:check-for-label: - # if is-label?(word-slice) break - # . eax = is-label?(word-slice) + # if label?(word-slice) break + # . eax = label?(word-slice) # . . push args 52/push-edx # . . call - e8/call is-label?/disp32 + e8/call label?/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp # . if (eax != false) break @@ -2268,7 +2268,7 @@ $emit-segments:check-disp32: $emit-segments:emit-disp32: # var value/eax = info->address 8b/copy 1/mod/*+disp8 6/rm32/esi . . . 0/r32/eax 0xc/disp8 . # copy *(esi+12) to eax - # if (is-far-jump-or-call?) value = info->offset - offset-of-next-instruction + # if (far-jump-or-call?) value = info->offset - offset-of-next-instruction 81 7/subop/compare 3/mod/direct 7/rm32/edi . . . . . 0/imm32/false # compare edi 74/jump-if-= $emit-segments:really-emit-disp32/disp8 8b/copy 1/mod/*+disp8 6/rm32/esi . . . 0/r32/eax 8/disp8 . # copy *(esi+8) to eax @@ -3005,7 +3005,7 @@ test-emit-segments-code-label-absolute: # reads line to make some checks # don't assume the read state of line after calling this function -is-far-jump-or-call?: # line: (addr stream byte) -> result/edi: boolean +far-jump-or-call?: # line: (addr stream byte) -> result/edi: boolean # . prologue 55/push-ebp 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp @@ -3026,7 +3026,7 @@ is-far-jump-or-call?: # line: (addr stream byte) -> result/edi: boolean 89/copy 3/mod/direct 3/rm32/ebx . . . 4/r32/esp . . # copy esp to ebx # result = false bf/copy-to-edi 0/imm32/false -$is-far-jump-or-call?:check-first-word: +$far-jump-or-call?:check-first-word: # next-word(line, word-slice) # . . push args 52/push-edx @@ -3045,7 +3045,7 @@ $is-far-jump-or-call?:check-first-word: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp # . if (eax != 0) return 3d/compare-eax-and 0/imm32/false - 0f 85/jump-if-!= $is-far-jump-or-call?:end/disp32 + 0f 85/jump-if-!= $far-jump-or-call?:end/disp32 # datum = next-token-from-slice(word-slice->start, word-slice->end, "/") # . . push args 53/push-ebx @@ -3067,7 +3067,7 @@ $is-far-jump-or-call?:check-first-word: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # . if (eax != false) return true 3d/compare-eax-and 0/imm32/false - 75/jump-if-!= $is-far-jump-or-call?:return-true/disp8 + 75/jump-if-!= $far-jump-or-call?:return-true/disp8 # if (datum-slice == "e9") return true # . eax = slice-equal?(datum-slice, "e9") # . . push args @@ -3079,7 +3079,7 @@ $is-far-jump-or-call?:check-first-word: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # . if (eax != false) return true 3d/compare-eax-and 0/imm32/false - 75/jump-if-!= $is-far-jump-or-call?:return-true/disp8 + 75/jump-if-!= $far-jump-or-call?:return-true/disp8 # if (datum-slice != "0f") return false # . eax = slice-equal?(datum-slice, "0f") # . . push args @@ -3091,8 +3091,8 @@ $is-far-jump-or-call?:check-first-word: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # . if (eax == false) return 3d/compare-eax-and 0/imm32/false - 74/jump-if-= $is-far-jump-or-call?:end/disp8 -$is-far-jump-or-call?:check-second-word: + 74/jump-if-= $far-jump-or-call?:end/disp8 +$far-jump-or-call?:check-second-word: # next-word(line, word-slice) # . . push args 52/push-edx @@ -3111,7 +3111,7 @@ $is-far-jump-or-call?:check-second-word: 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp # . if (eax != 0) return 3d/compare-eax-and 0/imm32/false - 75/jump-if-!= $is-far-jump-or-call?:end/disp8 + 75/jump-if-!= $far-jump-or-call?:end/disp8 # if datum of word-slice does not start with "8", return false # . start/eax = word-slice->start 8b/copy 0/mod/indirect 2/rm32/edx . . . 0/r32/eax . . # copy *edx to eax @@ -3120,11 +3120,11 @@ $is-far-jump-or-call?:check-second-word: 81 4/subop/and 3/mod/direct 0/rm32/eax . . . . . 0xff/imm32 # bitwise and of eax # . if (eax != '8') return 3d/compare-eax-and 0x38/imm32/8 - 75/jump-if-!= $is-far-jump-or-call?:end/disp8 + 75/jump-if-!= $far-jump-or-call?:end/disp8 # otherwise return true -$is-far-jump-or-call?:return-true: +$far-jump-or-call?:return-true: bf/copy-to-edi 1/imm32/true -$is-far-jump-or-call?:end: +$far-jump-or-call?:end: # . reclaim locals 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32 # add to esp # . restore registers @@ -4092,7 +4092,7 @@ num-bytes: # line: (addr stream byte) -> eax: int # break # if slice-starts-with?(word-slice, "#") # comment # break - # if is-label?(word-slice) # no need for label declarations anymore + # if label?(word-slice) # no need for label declarations anymore # break # if slice-equal?(word-slice, "==") # break # no need for segment header lines diff --git a/linux/tests b/linux/tests index 48f4e973..65c743fd 100755 Binary files a/linux/tests and b/linux/tests differ diff --git a/linux/tests.subx b/linux/tests.subx index 543e488d..63d64194 100644 --- a/linux/tests.subx +++ b/linux/tests.subx @@ -82,7 +82,7 @@ subx-gen-run-tests: # in: (addr buffered-file), out: (addr buffered-file) # var word-slice = next-word(line) # if slice-empty?(word-slice) # empty line # continue - # if is-label?(word-slice) + # if label?(word-slice) # if slice-starts-with?(word-slice, "test-") # tests-found = true # write(new-code-segment, " e8/call ") @@ -197,12 +197,12 @@ $subx-gen-run-tests:check-empty: 3d/compare-eax-and 0/imm32/false 75/jump-if-!= $subx-gen-run-tests:loop/disp8 $subx-gen-run-tests:check-for-label: - # if (!is-label?(word-slice)) continue - # . eax = is-label?(word-slice) + # if (!label?(word-slice)) continue + # . eax = label?(word-slice) # . . push args 52/push-edx # . . call - e8/call is-label?/disp32 + e8/call label?/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp # . if (eax == false) continue diff --git a/linux/tile/environment.mu b/linux/tile/environment.mu index de771dee..3c869d3c 100644 --- a/linux/tile/environment.mu +++ b/linux/tile/environment.mu @@ -1078,8 +1078,8 @@ fn copy-unbound-words-to-args _functions: (addr handle function) { $copy-unbound-words-to-args:loop-iter: { # is it a number? { - var is-int?/eax: boolean <- word-is-decimal-integer? curr - compare is-int?, 0/false + var int?/eax: boolean <- word-is-decimal-integer? curr + compare int?, 0/false break-if-!= $copy-unbound-words-to-args:loop-iter } # is it a pre-existing function? diff --git a/linux/tile/grapheme-stack.mu b/linux/tile/grapheme-stack.mu index e0d40ecc..0ea59ae5 100644 --- a/linux/tile/grapheme-stack.mu +++ b/linux/tile/grapheme-stack.mu @@ -181,7 +181,7 @@ fn grapheme-stack-is-decimal-integer? _self: (addr grapheme-stack) -> _/eax: boo compare i, *top-addr break-if->= var g/edx: (addr grapheme) <- index data, i - result <- is-decimal-digit? *g + result <- decimal-digit? *g compare result, 0/false break-if-= i <- increment diff --git a/linux/tile/rpn.mu b/linux/tile/rpn.mu index bf81308b..95d5356a 100644 --- a/linux/tile/rpn.mu +++ b/linux/tile/rpn.mu @@ -18,8 +18,8 @@ fn evaluate functions: (addr handle function), bindings: (addr table), scratch: ### if curr-stream is an operator, perform it ## numbers { - var is-add?/eax: boolean <- stream-data-equal? curr-stream, "+" - compare is-add?, 0 + var add?/eax: boolean <- stream-data-equal? curr-stream, "+" + compare add?, 0 break-if-= var _b/xmm0: float <- pop-number-from-value-stack out var b/xmm1: float <- copy _b @@ -29,8 +29,8 @@ fn evaluate functions: (addr handle function), bindings: (addr table), scratch: break $evaluate:process-word } { - var is-sub?/eax: boolean <- stream-data-equal? curr-stream, "-" - compare is-sub?, 0 + var sub?/eax: boolean <- stream-data-equal? curr-stream, "-" + compare sub?, 0 break-if-= var _b/xmm0: float <- pop-number-from-value-stack out var b/xmm1: float <- copy _b @@ -40,8 +40,8 @@ fn evaluate functions: (addr handle function), bindings: (addr table), scratch: break $evaluate:process-word } { - var is-mul?/eax: boolean <- stream-data-equal? curr-stream, "*" - compare is-mul?, 0 + var mul?/eax: boolean <- stream-data-equal? curr-stream, "*" + compare mul?, 0 break-if-= var _b/xmm0: float <- pop-number-from-value-stack out var b/xmm1: float <- copy _b @@ -51,8 +51,8 @@ fn evaluate functions: (addr handle function), bindings: (addr table), scratch: break $evaluate:process-word } { - var is-div?/eax: boolean <- stream-data-equal? curr-stream, "/" - compare is-div?, 0 + var div?/eax: boolean <- stream-data-equal? curr-stream, "/" + compare div?, 0 break-if-= var _b/xmm0: float <- pop-number-from-value-stack out var b/xmm1: float <- copy _b @@ -62,8 +62,8 @@ fn evaluate functions: (addr handle function), bindings: (addr table), scratch: break $evaluate:process-word } { - var is-sqrt?/eax: boolean <- stream-data-equal? curr-stream, "sqrt" - compare is-sqrt?, 0 + var sqrt?/eax: boolean <- stream-data-equal? curr-stream, "sqrt" + compare sqrt?, 0 break-if-= var a/xmm0: float <- pop-number-from-value-stack out a <- square-root a @@ -72,8 +72,8 @@ fn evaluate functions: (addr handle function), bindings: (addr table), scratch: } ## strings/arrays { - var is-len?/eax: boolean <- stream-data-equal? curr-stream, "len" - compare is-len?, 0 + var len?/eax: boolean <- stream-data-equal? curr-stream, "len" + compare len?, 0 break-if-= #? print-string 0, "is len\n" # pop target-val from out @@ -127,8 +127,8 @@ fn evaluate functions: (addr handle function), bindings: (addr table), scratch: } ## files { - var is-open?/eax: boolean <- stream-data-equal? curr-stream, "open" - compare is-open?, 0 + var open?/eax: boolean <- stream-data-equal? curr-stream, "open" + compare open?, 0 break-if-= # pop target-val from out var out2/esi: (addr value-stack) <- copy out @@ -160,8 +160,8 @@ fn evaluate functions: (addr handle function), bindings: (addr table), scratch: break $evaluate:process-word } { - var is-read?/eax: boolean <- stream-data-equal? curr-stream, "read" - compare is-read?, 0 + var read?/eax: boolean <- stream-data-equal? curr-stream, "read" + compare read?, 0 break-if-= # pop target-val from out var out2/esi: (addr value-stack) <- copy out @@ -195,8 +195,8 @@ fn evaluate functions: (addr handle function), bindings: (addr table), scratch: break $evaluate:process-word } { - var is-slurp?/eax: boolean <- stream-data-equal? curr-stream, "slurp" - compare is-slurp?, 0 + var slurp?/eax: boolean <- stream-data-equal? curr-stream, "slurp" + compare slurp?, 0 break-if-= # pop target-val from out var out2/esi: (addr value-stack) <- copy out @@ -230,8 +230,8 @@ fn evaluate functions: (addr handle function), bindings: (addr table), scratch: break $evaluate:process-word } { - var is-lines?/eax: boolean <- stream-data-equal? curr-stream, "lines" - compare is-lines?, 0 + var lines?/eax: boolean <- stream-data-equal? curr-stream, "lines" + compare lines?, 0 break-if-= # pop target-val from out var out2/esi: (addr value-stack) <- copy out @@ -280,8 +280,8 @@ fn evaluate functions: (addr handle function), bindings: (addr table), scratch: } ## screens { - var is-fake-screen?/eax: boolean <- stream-data-equal? curr-stream, "fake-screen" - compare is-fake-screen?, 0 + var fake-screen?/eax: boolean <- stream-data-equal? curr-stream, "fake-screen" + compare fake-screen?, 0 break-if-= var out2/esi: (addr value-stack) <- copy out var top-addr/ecx: (addr int) <- get out2, top @@ -312,8 +312,8 @@ fn evaluate functions: (addr handle function), bindings: (addr table), scratch: break $evaluate:process-word } { - var is-print?/eax: boolean <- stream-data-equal? curr-stream, "print" - compare is-print?, 0 + var print?/eax: boolean <- stream-data-equal? curr-stream, "print" + compare print?, 0 break-if-= var out2/esi: (addr value-stack) <- copy out var top-addr/ecx: (addr int) <- get out2, top @@ -349,8 +349,8 @@ fn evaluate functions: (addr handle function), bindings: (addr table), scratch: break $evaluate:process-word } { - var is-move?/eax: boolean <- stream-data-equal? curr-stream, "move" - compare is-move?, 0 + var move?/eax: boolean <- stream-data-equal? curr-stream, "move" + compare move?, 0 break-if-= var out2/esi: (addr value-stack) <- copy out # pop args @@ -378,8 +378,8 @@ fn evaluate functions: (addr handle function), bindings: (addr table), scratch: break $evaluate:process-word } { - var is-up?/eax: boolean <- stream-data-equal? curr-stream, "up" - compare is-up?, 0 + var up?/eax: boolean <- stream-data-equal? curr-stream, "up" + compare up?, 0 break-if-= var out2/esi: (addr value-stack) <- copy out var top-addr/ebx: (addr int) <- get out2, top @@ -421,8 +421,8 @@ fn evaluate functions: (addr handle function), bindings: (addr table), scratch: break $evaluate:process-word } { - var is-down?/eax: boolean <- stream-data-equal? curr-stream, "down" - compare is-down?, 0 + var down?/eax: boolean <- stream-data-equal? curr-stream, "down" + compare down?, 0 break-if-= var out2/esi: (addr value-stack) <- copy out var top-addr/ebx: (addr int) <- get out2, top @@ -466,8 +466,8 @@ fn evaluate functions: (addr handle function), bindings: (addr table), scratch: break $evaluate:process-word } { - var is-left?/eax: boolean <- stream-data-equal? curr-stream, "left" - compare is-left?, 0 + var left?/eax: boolean <- stream-data-equal? curr-stream, "left" + compare left?, 0 break-if-= var out2/esi: (addr value-stack) <- copy out var top-addr/ebx: (addr int) <- get out2, top @@ -510,8 +510,8 @@ fn evaluate functions: (addr handle function), bindings: (addr table), scratch: break $evaluate:process-word } { - var is-right?/eax: boolean <- stream-data-equal? curr-stream, "right" - compare is-right?, 0 + var right?/eax: boolean <- stream-data-equal? curr-stream, "right" + compare right?, 0 break-if-= var out2/esi: (addr value-stack) <- copy out var top-addr/ebx: (addr int) <- get out2, top @@ -556,8 +556,8 @@ fn evaluate functions: (addr handle function), bindings: (addr table), scratch: } ## HACKS: we're trying to avoid turning this into Forth { - var is-dup?/eax: boolean <- stream-data-equal? curr-stream, "dup" - compare is-dup?, 0 + var dup?/eax: boolean <- stream-data-equal? curr-stream, "dup" + compare dup?, 0 break-if-= # read src-val from out var out2/esi: (addr value-stack) <- copy out @@ -581,8 +581,8 @@ fn evaluate functions: (addr handle function), bindings: (addr table), scratch: break $evaluate:process-word } { - var is-swap?/eax: boolean <- stream-data-equal? curr-stream, "swap" - compare is-swap?, 0 + var swap?/eax: boolean <- stream-data-equal? curr-stream, "swap" + compare swap?, 0 break-if-= # read top-val from out var out2/esi: (addr value-stack) <- copy out @@ -869,22 +869,22 @@ fn max-stack-depth first-word: (addr word), final-word: (addr word) -> _/edi: in $max-stack-depth:process-word: { # handle operators { - var is-add?/eax: boolean <- word-equal? curr-word, "+" - compare is-add?, 0 + var add?/eax: boolean <- word-equal? curr-word, "+" + compare add?, 0 break-if-= curr-depth <- decrement break $max-stack-depth:process-word } { - var is-sub?/eax: boolean <- word-equal? curr-word, "-" - compare is-sub?, 0 + var sub?/eax: boolean <- word-equal? curr-word, "-" + compare sub?, 0 break-if-= curr-depth <- decrement break $max-stack-depth:process-word } { - var is-mul?/eax: boolean <- word-equal? curr-word, "*" - compare is-mul?, 0 + var mul?/eax: boolean <- word-equal? curr-word, "*" + compare mul?, 0 break-if-= curr-depth <- decrement break $max-stack-depth:process-word diff --git a/linux/tile/table.mu b/linux/tile/table.mu index 9c03117b..c3ad654a 100644 --- a/linux/tile/table.mu +++ b/linux/tile/table.mu @@ -122,8 +122,8 @@ fn lookup-binding _self: (addr table), key: (addr array byte), out: (addr handle var target3/eax: (addr array byte) <- lookup *target2 compare target3, 0 break-if-= $lookup-binding:loop - var is-match?/eax: boolean <- string-equal? target3, key - compare is-match?, 0/false + var match?/eax: boolean <- string-equal? target3, key + compare match?, 0/false break-if-= # found var target/eax: (addr handle value) <- get target-bind, value -- cgit 1.4.1-2-gfad0