[A83] Re: Faster Multiplication


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

[A83] Re: Faster Multiplication




At 11:00 AM 5/30/01 -0700, you wrote:
>
>
>;quick multiply
>;Input: C and E
>;Output: Hl = C*E
>mult:
>    xor a       ;flush a
>    ld h,a      ;flush hl and d
>    ld l,a
>    ld d,a
>    ld a,c      ;save c to a to check...
>    cp e        ;here we check too see which one is bigger, c or e
>    jp c,mulswitch  ;if c is smaller then e, switch them!
>:MulCode1
>    xor a       ;reset a
>    cp c        ;and the check for 0
>:MulCode        ;normal multiplication code...
>    ret z
>    add hl,de
>    dec c
>    jp MulCode
>:mulswitch      ;switch c and e, then run the main code
>    ld a,c
>    ld c,e
>    ld e,a
>;    ld a,0
>;    cp c
>    jp MulCode1
>
>

THe code looks pretty short; howz about some jr's to shorten in byte-wise?




References: