diff options
author | Kartik Agaram <vc@akkartik.com> | 2020-01-27 00:36:44 -0800 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2020-01-27 00:36:44 -0800 |
commit | 71eb22a5bf94f5fa0a3c95212450e3c6a1a6a990 (patch) | |
tree | 56307b5145be44b2239d3c782234309ed714f1b6 /apps/factorial4.subx | |
parent | 1a65c3af0f797892f5981f8ebd33c275c1ef06b0 (diff) | |
download | mu-71eb22a5bf94f5fa0a3c95212450e3c6a1a6a990.tar.gz |
5924
Diffstat (limited to 'apps/factorial4.subx')
-rw-r--r-- | apps/factorial4.subx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/factorial4.subx b/apps/factorial4.subx index 5f8c6aef..eb42adf2 100644 --- a/apps/factorial4.subx +++ b/apps/factorial4.subx @@ -55,7 +55,7 @@ Entry: # run tests if necessary, compute `factorial(5)` if not b8/copy-to-eax 1/imm32/exit cd/syscall 0x80/imm8 -factorial: # n : int -> int/eax +factorial: # n: int -> int/eax # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp @@ -70,7 +70,7 @@ factorial: # n : int -> int/eax # if (n > 1) return n * factorial(n-1) { 7e/jump-if-<= break/disp8 - # var ebx : int = n-1 + # var ebx: int = n-1 8b/-> *(ebp+8) 3/r32/ebx 4b/decrement-ebx (factorial %ebx) # => eax |