diff options
author | Marcus Huderle <huderlem@gmail.com> | 2017-09-13 18:08:08 -0700 |
---|---|---|
committer | Marcus Huderle <huderlem@gmail.com> | 2017-09-13 18:08:08 -0700 |
commit | b30ac0c5f2bd5b840424dc6b41bcf2f0c4524064 (patch) | |
tree | f274a0db1bd002c172d23dbc511823674499dc76 | |
parent | f2d839a1f498ff22ecb239bfc4d7c2752a652afd (diff) |
Properly name the ancient-Egyptian-style multiplication routine
-rw-r--r-- | home.asm | 5 | ||||
-rw-r--r-- | home/random.asm | 2 |
2 files changed, 4 insertions, 3 deletions
@@ -785,9 +785,10 @@ INCLUDE "home/random.asm" INCLUDE "home/joypad.asm" INCLUDE "home/palettes.asm" -HorrendousMultiplyAbyL: ; 0xdd4 +MultiplyAbyL_AncientEgyptian: ; 0xdd4 ; Return a * l to hl -; Stupid waste of space +; This is a constant-time multiplication algorithm that uses binary decomposition to achieve the result. +; See https://en.wikipedia.org/wiki/Ancient_Egyptian_multiplication push bc ld c, l ld b, $0 diff --git a/home/random.asm b/home/random.asm index ce34f69..c532ec5 100644 --- a/home/random.asm +++ b/home/random.asm @@ -119,7 +119,7 @@ RandomRange: ; 0xa21 add hl, bc ld l, [hl] call GenRandom - call HorrendousMultiplyAbyL + call MultiplyAbyL_AncientEgyptian inc h srl h ld a, h |