Re: A86: Sorry Dux. =-|
[Prev][Next][Index][Thread]
Re: A86: Sorry Dux. =-|
Joshua J Seagoe wrote:
>
> why clear a?
Pardon me while I go bury my head in the sand. <-(
And Kirk Meyer, almighty creator of SC2K missed that. =)
Originally, I wanted the output to be ahl.
Russian Peasant's Algorithm:
made by Dux Gregis
modified and renamed by Tim Farrell
(head currently buried in sand)
nitpicked by Kirk Meyer
scrutinized by RabidCow
Really Really Final Version - (Shut Up! =)
;African Swallow Algorithm_________________________
;Input: de * b |
;Output: hl |
;Destroys: b, de, hl |
;Size: 14 bytes |
;--------------------------------------------------
ASMult:
ld hl, $0000 ;Ugh, I'm tired of changing this comment
ASMultLp:
srl b ;check bit
jp nc, ASkipadd ;if bit = 1 then hl + de
add hl, de ;add'm up
ASkipadd:
add hl, hl ;mult hl by 2
jp nz, ASMultLp ;if b != 0 then keep going
ret ;ret
--
Tercero -- Email: mailto:tercero@busprod.com
"The stone the builders rejected has become the capstone;"
--Psalms 118:22
"Everyone who falls on that stone will be broken to pieces,
but he on whom it falls will be crushed."
--Luke 20:18
Follow-Ups:
References: