about summary refs log tree commit diff stats
path: root/apps/arith.mu
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-09-14 21:14:04 -0700
committerKartik Agaram <vc@akkartik.com>2020-09-14 21:14:04 -0700
commit6b41ca6d95bf6dbafab3fdc85d7355ac8b365931 (patch)
treeffab6daf3af380a661185d9b072d64640194c65c /apps/arith.mu
parent40d40b83decac3d4f9a3da2dc222d19d1ab704f1 (diff)
downloadmu-6b41ca6d95bf6dbafab3fdc85d7355ac8b365931.tar.gz
6777
Print answers in decimal in apps/arith.mu
Diffstat (limited to 'apps/arith.mu')
-rw-r--r--apps/arith.mu17
1 files changed, 8 insertions, 9 deletions
diff --git a/apps/arith.mu b/apps/arith.mu
index ebc9850c..fdf97213 100644
--- a/apps/arith.mu
+++ b/apps/arith.mu
@@ -4,7 +4,6 @@
 #   https://compilers.iecc.com/crenshaw
 #
 # Limitations:
-#   Reads numbers in decimal, but prints numbers in hex :(
 #   No division yet.
 #
 # To build:
@@ -14,19 +13,19 @@
 #   $ ./a.elf
 #   press ctrl-c or ctrl-d to exit
 #   > 1
-#   0x00000001
+#   1
 #   > 1+1
-#   0x00000002
+#   2
 #   > 1 + 1
-#   0x00000002
+#   2
 #   > 1+2 +3
-#   0x00000006
+#   6
 #   > 1+2 *3
-#   0x00000007
+#   7
 #   > (1+2) *3
-#   0x00000009
+#   9
 #   > 1 + 3*4
-#   0x0000000d
+#   13
 #   > ^D
 #   $
 #
@@ -46,7 +45,7 @@ fn main -> exit-status/ebx: int {
     compare look, 0
     break-if-=
     # print
-    print-int32-hex 0, n
+    print-int32-decimal 0, n
     print-string 0, "\n"
     #
     loop