diff options
author | Rangi <remy.oukaour+rangi42@gmail.com> | 2018-06-24 21:23:51 -0400 |
---|---|---|
committer | Rangi <remy.oukaour+rangi42@gmail.com> | 2018-06-24 21:23:51 -0400 |
commit | e2fb7acac0e3c1d598021b52fc2583dd983321bc (patch) | |
tree | ea5922596ce167e5b0485ea3bacd65f43339ca60 /home/math.asm | |
parent | 1a888f22004aec967d2b6049ede7e04b1815f956 (diff) | |
parent | 364854623267a8a39242243b0cdf80144e868642 (diff) |
Merge branch 'master' of https://github.com/pret/pokecrystal
# Conflicts:
# engine/items/mart.asm
Diffstat (limited to 'home/math.asm')
-rw-r--r-- | home/math.asm | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/home/math.asm b/home/math.asm index 6a779e378..4a1711343 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,9 @@ 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 +34,9 @@ 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 +47,9 @@ 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 +60,9 @@ Divide:: ; 3124 pop de pop hl ret -; 3136 -SubtractSigned:: ; 3136 +SubtractSigned:: ; Return a - b, sign in carry. sub b ret nc @@ -75,4 +70,3 @@ SubtractSigned:: ; 3136 add 1 scf ret -; 313d |