From 7c2ac5dcaa9ffab09ebbf90e7c0ce937a2aa591b Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Tue, 18 Feb 2020 16:05:13 -0800 Subject: 6026 --- html/apps/factorial.mu.html | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'html/apps') diff --git a/html/apps/factorial.mu.html b/html/apps/factorial.mu.html index 92db0c5b..7e3cf43f 100644 --- a/html/apps/factorial.mu.html +++ b/html/apps/factorial.mu.html @@ -60,28 +60,28 @@ if ('onhashchange' in window) { 2 # ./translate_mu apps/factorial.mu 3 # ./a.elf test # any args? run tests 4 # ./a.elf # no args? run factorial(5) - 5 fn main args: (addr array kernel-string) -> exit-status/ebx: int { + 5 fn main args: (addr array kernel-string) -> exit-status/ebx: int { 6 var a/eax: (addr array kernel-string) <- copy args 7 var tmp/ecx: int <- length a 8 $main-body: { 9 compare tmp, 1 -10 # if (len(args) != 1) run-tests() +10 # if (len(args) == 1) factorial(5) 11 { -12 break-if-= -13 run-tests -14 exit-status <- copy 0 +12 break-if-!= +13 var tmp/eax: int <- factorial 5 +14 exit-status <- copy tmp 15 break $main-body 16 } -17 # if (len(args) == 1) factorial(5) +17 # if (len(args) != 1) run-tests() 18 { -19 break-if-!= -20 var tmp/eax: int <- factorial 5 -21 exit-status <- copy tmp +19 break-if-= +20 run-tests +21 exit-status <- copy 0 22 } 23 } 24 } 25 -26 fn factorial n: int -> result/eax: int { +26 fn factorial n: int -> result/eax: int { 27 compare n 1 28 { 29 break-if-> @@ -91,13 +91,13 @@ if ('onhashchange' in window) { 33 break-if-<= 34 var tmp/ecx: int <- copy n 35 tmp <- decrement -36 result <- factorial tmp +36 result <- factorial tmp 37 result <- multiply n 38 } 39 } 40 -41 fn test-factorial { -42 var result/eax: int <- factorial 5 +41 fn test-factorial { +42 var result/eax: int <- factorial 5 43 check-ints-equal result 0x78 "F - test-factorial" 44 } -- cgit 1.4.1-2-gfad0