diff options
author | Thomas Winwood <twwinwood@gmail.com> | 2018-07-21 02:06:31 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-21 02:06:31 +0100 |
commit | 23ef2f50a7b94c23b50e9e690a7482ac349c9ef3 (patch) | |
tree | 63c20c67efbdf8334c6e273f78065b83135e3886 /home/math.asm | |
parent | 17a4d0540acc00e3f5ad260009115eb36e72b7d2 (diff) | |
parent | 2d73d040d16a7836f935a7a6cb2a311aed2ca5a2 (diff) |
Merge branch 'master' into the-diffening
Diffstat (limited to 'home/math.asm')
-rw-r--r-- | home/math.asm | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/home/math.asm b/home/math.asm index 6a779e378..f385ccbf8 100644 --- a/home/math.asm +++ b/home/math.asm @@ -1,4 +1,4 @@ -AddNTimes:: ; 0x30fe +AddNTimes:: ; Add bc * a to hl. and a ret z @@ -7,9 +7,8 @@ AddNTimes:: ; 0x30fe dec a jr nz, .loop ret -; 0x3105 -SimpleMultiply:: ; 3105 +SimpleMultiply:: ; Return a * c. and a ret z @@ -23,10 +22,8 @@ SimpleMultiply:: ; 3105 jr nz, .loop pop bc ret -; 3110 - -SimpleDivide:: ; 3110 +SimpleDivide:: ; Divide a by c. Return quotient b and remainder a. ld b, 0 .loop @@ -36,10 +33,8 @@ SimpleDivide:: ; 3110 dec b add c ret -; 3119 - -Multiply:: ; 3119 +Multiply:: ; Multiply hMultiplicand (3 bytes) by hMultiplier. Result in hProduct. ; All values are big endian. push hl @@ -50,10 +45,8 @@ Multiply:: ; 3119 pop bc pop hl ret -; 3124 - -Divide:: ; 3124 +Divide:: ; Divide hDividend length b (max 4 bytes) by hDivisor. Result in hQuotient. ; All values are big endian. push hl @@ -64,10 +57,8 @@ Divide:: ; 3124 pop de pop hl ret -; 3136 - -SubtractSigned:: ; 3136 +SubtractSigned:: ; Return a - b, sign in carry. sub b ret nc @@ -75,4 +66,3 @@ SubtractSigned:: ; 3136 add 1 scf ret -; 313d |