From 6b41ca6d95bf6dbafab3fdc85d7355ac8b365931 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Mon, 14 Sep 2020 21:14:04 -0700 Subject: 6777 Print answers in decimal in apps/arith.mu --- apps/arith.mu | 17 ++++++++--------- apps/mu | Bin 389284 -> 389400 bytes 2 files changed, 8 insertions(+), 9 deletions(-) (limited to 'apps') 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 diff --git a/apps/mu b/apps/mu index e44e8e4e..5bb5022e 100755 Binary files a/apps/mu and b/apps/mu differ -- cgit 1.4.1-2-gfad0