diff options
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 |