about summary refs log tree commit diff stats
path: root/apps/factorial2.subx
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2019-12-09 16:53:57 -0800
committerKartik Agaram <vc@akkartik.com>2019-12-09 16:53:57 -0800
commitef21004a5c5b655b7e352f658a8368986ac1c1df (patch)
tree5c88556ff09014bef796def3200aa79ce0859e28 /apps/factorial2.subx
parentaf1473922226e0ea07e6da9f486634702a6915c1 (diff)
downloadmu-ef21004a5c5b655b7e352f658a8368986ac1c1df.tar.gz
5809
Diffstat (limited to 'apps/factorial2.subx')
-rw-r--r--apps/factorial2.subx8
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/factorial2.subx b/apps/factorial2.subx
index ecaccbcf..e512521a 100644
--- a/apps/factorial2.subx
+++ b/apps/factorial2.subx
@@ -45,8 +45,8 @@ Entry:  # run tests if necessary, compute `factorial(5)` if not
     e8/call kernel-string-equal?/disp32
     # . . discard args
     81 0/subop/add %esp 8/imm32
-    # . if (eax == 0) goto run-main
-    3d/compare-eax-and 0/imm32
+    # . if (eax == false) goto run-main
+    3d/compare-eax-and 0/imm32/false
     74/jump-if-equal $run-main/disp8
     # run-tests()
     e8/call run-tests/disp32
@@ -77,10 +77,10 @@ factorial:  # n : int -> int/eax
     b8/copy-to-eax 1/imm32
     81 7/subop/compare *(ebp+8) 1/imm32
     7e/jump-if-<= $factorial:end/disp8
-    # ebx = n-1
+    # var ebx : int = n-1
     8b/-> *(ebp+8) 3/r32/ebx
     4b/decrement-ebx
-    # eax = factorial(n-1)
+    # var eax : int = factorial(n-1)
     # . . push args
     53/push-ebx
     # . . call