_Divide results go in hQuotient and hRemainder, not in hDividend and hDivisor

Note that the result quotient is four bytes, but hQuotient is a three-byte buffer. This is because no Divide caller ever needed a four-byte quotient, so the buffer didn't include the high byte.
This commit is contained in:
Rangi 2018-08-25 22:58:26 -04:00
parent 4c8c5c10a8
commit 296402bd31
1 changed files with 5 additions and 5 deletions

View File

@ -172,18 +172,18 @@ _Divide::
.done
ldh a, [hDividend + 1]
ldh [hDivisor], a
ldh [hRemainder], a
ldh a, [hMathBuffer + 4]
ldh [hDividend + 3], a
ldh [hQuotient + 2], a
ldh a, [hMathBuffer + 3]
ldh [hDividend + 2], a
ldh [hQuotient + 1], a
ldh a, [hMathBuffer + 2]
ldh [hDividend + 1], a
ldh [hQuotient + 0], a
ldh a, [hMathBuffer + 1]
ldh [hDividend + 0], a
ldh [hQuotient - 1], a
ret