[A83] Re: Faster Multiplication


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

[A83] Re: Faster Multiplication




jp's are faster and only 1 byte bigger..
----------------------------------------------
Original Message
From: "Gavin Olson"<gtolson@snet.net>
Subject: [A83] Re: Faster Multiplication
Date: Wed, 30 May 2001 18:49:03 -0400

>
>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?
>
>
>
>

_____________________________________________
Free email with personality! Over 200 domains!
http://www.MyOwnEmail.com