diff options
Diffstat (limited to 'apps/factorial.mu')
-rw-r--r-- | apps/factorial.mu | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/apps/factorial.mu b/apps/factorial.mu index 83b2bedf..55bee98e 100644 --- a/apps/factorial.mu +++ b/apps/factorial.mu @@ -31,21 +31,21 @@ fn test-factorial { check-ints-equal result 0x78 "F - test-factorial" } -fn main args: (addr array kernel-string) -> exit-status/ebx: int { - var a/eax: (addr array kernel-string) <- copy args +fn main args: (addr array string) -> exit-status/ebx: int { + var a/eax: (addr array string) <- copy args var tmp/ecx: int <- length a $main-body: { - compare tmp, 1 - # if (len(args) == 1) factorial(5) + # if (len(args) <= 4) factorial(5) + compare tmp, 4 { - break-if-!= + break-if-> var tmp/eax: int <- factorial 5 exit-status <- copy tmp break $main-body } # if (args[1] == "test") run-tests() - var tmp2/ecx: (addr kernel-string) <- index a, 1 - var tmp3/eax: boolean <- kernel-string-equal? *tmp2, "test" + var tmp2/ecx: (addr string) <- index a, 1 + var tmp3/eax: boolean <- string-equal? *tmp2, "test" compare tmp3, 0 { break-if-= |