Re: A83: Contest II (MUL/DIV)...


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

Re: A83: Contest II (MUL/DIV)...




In accordance with the prophecy, Thomas J. Hruska uttered:

>  MUL A,A  MUL B,A  MUL C,A  MUL D,A  MUL E,A  MUL H,A  MUL L,A
>  MUL A,B  MUL B,B  MUL C,B  MUL D,B  MUL E,B  MUL H,B  MUL L,B
>  MUL A,C  MUL B,C  MUL C,C  MUL D,C  MUL E,C  MUL H,C  MUL L,C
>  MUL A,D  MUL B,D  MUL C,D  MUL D,D  MUL E,D  MUL H,D  MUL L,D
>  MUL A,E  MUL B,E  MUL C,E  MUL D,E  MUL E,E  MUL H,E  MUL L,E
>  MUL A,H  MUL B,H  MUL C,H  MUL D,H  MUL E,H  MUL H,H  MUL L,H
>  MUL A,L  MUL B,L  MUL C,L  MUL D,L  MUL E,L  MUL H,L  MUL L,L
>  MUL A,@  MUL B,@  MUL C,@  MUL D,@  MUL E,@  MUL H,@  MUL L,@
>  MUL A,(HL)
>  MUL B,(HL)
>  MUL C,(HL)
>  MUL D,(HL)
>  MUL E,(HL)
>  MUL H,(HL)
>  MUL L,(HL)
>  MUL HL,BC
>  MUL HL,DE
>  MUL HL,HL
>  MUL HL,@@
>  MUL HL,(@@)

Oh yeah? So that when some noodle writes A*4 in a program, your TAZM will do
a cumbersome multiplication instead of the user actually learning that a
logical shift left is both quicker & cleaner?

By the way, did it occur to you that an 8 bit multiplication generally has a
16 bit result? No? Then what's the use of MUL A,B writing its lower 8 bits
into A and discarding the rest of the result? I know, adding two 8 bit
numbers results in a 9 bit number, but the z80 provides a special carry flag
for that 9th bit so the whole result is kept.

TI provides us with a routine called _HTIMESL. I'm not claiming that it's
fully optimized, though it might well be. But at least it provides 16 bits
for the result.

Linus

- --- Linus Akesson ------------------------ http://linusworld.cjb.net --- -


              Proofread carefully to see if you any words out.



Follow-Ups: References: