about summary refs log tree commit diff stats
path: root/apps/factorial4.subx
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-01-16 18:31:12 -0800
committerKartik Agaram <vc@akkartik.com>2020-01-16 18:31:12 -0800
commit6070c23e5e1c60d3bb169e43bddfa59b1d322427 (patch)
tree9a70e378c33c15e4779cf94abda8f37c35a5d1da /apps/factorial4.subx
parent5a6601aba973ba1d1ef30b7b64438c25623b89c5 (diff)
downloadmu-6070c23e5e1c60d3bb169e43bddfa59b1d322427.tar.gz
5897 - rename comparison instructions
Signed and unsigned don't quite capture the essence of what the different
combinations of x86 flags are doing for SubX. The crucial distinction is
that one set of comparison operators is for integers and the second is
for addresses.
Diffstat (limited to 'apps/factorial4.subx')
-rw-r--r--apps/factorial4.subx10
1 files changed, 5 insertions, 5 deletions
diff --git a/apps/factorial4.subx b/apps/factorial4.subx
index 99d7bff4..5f8c6aef 100644
--- a/apps/factorial4.subx
+++ b/apps/factorial4.subx
@@ -31,11 +31,11 @@ Entry:  # run tests if necessary, compute `factorial(5)` if not
     {
       # if (argc <= 1) break
       81 7/subop/compare *ebp 1/imm32
-      7e/jump-if-lesser-or-equal break/disp8
+      7e/jump-if-<= break/disp8
       # if (!kernel-string-equal?(argv[1], "test")) break
       (kernel-string-equal? *(ebp+8) "test")  # => eax
       3d/compare-eax-and 0/imm32/false
-      74/jump-if-equal break/disp8
+      74/jump-if-= break/disp8
       #
       (run-tests)
       # eax = *Num-test-failures
@@ -45,7 +45,7 @@ Entry:  # run tests if necessary, compute `factorial(5)` if not
     {
       # if (argc > 1) break
       81 7/subop/compare *ebp 1/imm32
-      7f/jump-if-greater break/disp8
+      7f/jump-if-> break/disp8
       # eax = factorial(5)
       (factorial 5)
       # syscall(exit, eax)
@@ -64,12 +64,12 @@ factorial:  # n : int -> int/eax
     # if (n <= 1) return 1
     81 7/subop/compare *(ebp+8) 1/imm32
     {
-      7f/jump-if-greater break/disp8
+      7f/jump-if-> break/disp8
       b8/copy-to-eax 1/imm32
     }
     # if (n > 1) return n * factorial(n-1)
     {
-      7e/jump-if-lesser-or-equal break/disp8
+      7e/jump-if-<= break/disp8
       # var ebx : int = n-1
       8b/-> *(ebp+8) 3/r32/ebx
       4b/decrement-ebx