A86: 8x8 multiply routine?


[Prev][Next][Index][Thread]

A86: 8x8 multiply routine?




Anyone have a 8x8 multiply routine?

And please do not send me Rodney Zak's routine, it doesnt work... I mean it
is so
obvious why it doesnt work yet people have the nerve to put it on - here
check out this routine

;HL = L * E

 ld B, 8
MultLoop:

 add HL, HL
 jr nc, NoAdd
 add HL, DE
NoAdd:
 djnz MultLoop
 ret

Notice how HL doubles no matter what happens. That means L = L * 8. And
whats up with the carry? Acting like the register
is inverted or something. Then I saw some other "tricks" where people had
instructions like ADC H, 0.. thats an illegal
instruction!

Anyone have a really fast 8-bit by 8-bit routine THAT actually works? I
could design mine myself, but I have a feeling there may be a neat trick to
do so using shifts and adds

Later,
    Matt




Follow-Ups: