Re: A82: DE x 3/4?


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

Re: A82: DE x 3/4?




In a message dated 98-08-31 15:57:03 EDT, you write:

>    What is the fastest way to multiply DE by 3/4? I know a way but it is 
>  pretty bad, and I am not even sure it works. Please help.
>     Sam

first make sure hl is not important, then copy it to hl, add hl, hl, add hl,
de, and use the method of your choice to divide hl by 4, like so:

 ld de, 4
 ld bc, 0
 or a
Divloop:
 sbc hl, de
 inc bc
 jr nc, divloop

but then bc is also destroyed.  now that I look at it that's not really a good
way.  oh well

~Adamman