diff options
author | Kartik Agaram <vc@akkartik.com> | 2018-07-30 20:45:51 -0700 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2018-07-30 20:45:51 -0700 |
commit | 4e38301e910115a4f782b5a461a4830966d784ba (patch) | |
tree | a46132b79cb8fc9dcee261df5eb344a9db9b2097 | |
parent | d9824a1b9431829e9fcbf381c0add5366749ff9c (diff) | |
download | mu-4e38301e910115a4f782b5a461a4830966d784ba.tar.gz |
4465
-rw-r--r-- | subx/ex7.subx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/subx/ex7.subx b/subx/ex7.subx index c95ed361..fab91b6a 100644 --- a/subx/ex7.subx +++ b/subx/ex7.subx @@ -44,7 +44,7 @@ # 6e factorial: # initialize n - 8b/copy 1/mod/*+disp8 4/rm32/sib 4/base/esp 4/index/none 2/r32/edx 4/disp8 # copy *(ESP+4) to EDX + 8b/copy 1/mod/*+disp8 4/rm32/sib 4/base/ESP 4/index/none 2/r32/EDX 4/disp8 # copy *(ESP+4) to EDX # 72 # initialize EAX to 1 (base case) b8/copy 1/imm32 # copy 1 to EAX @@ -78,7 +78,7 @@ factorial: 5d/pop # pop to EBP # 94 # refresh n - 8b/copy 1/mod/*+disp8 4/rm32/sib 4/base/esp 4/index/none 2/r32/edx 4/disp8 # copy *(ESP+4) to EDX + 8b/copy 1/mod/*+disp8 4/rm32/sib 4/base/ESP 4/index/none 2/r32/EDX 4/disp8 # copy *(ESP+4) to EDX # 98 # return n * factorial(n-1) 0f af/multiply 3/mod/direct 2/rm32/EDX 0/r32/EAX # multiply EDX (n) into EAX (factorial(n-1)) |