Re: A82: Hmm


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

Re: A82: Hmm




>Actually, the fastest way would be inline assembly but the newest version
>of ANSI C (not sure what it is) is only about 4% slower than the
>assembly.  So I guess this message was kinda pointless...

Hideaki (who's quickly becoming one of the best assembly optimizers for both
x86 and z80 assembly) made this really cool assembly trick:

XOR ECX,ECX     ; 1/2 If needed (if ECX is already 0 obviously delete)
MOV EBX,Y       ; 1/2 If needed
MOV EAX,X       ; 1/2 If needed
MOV DL,COLOR    ; 1/2 If needed
MOV CH,BL       ; 1
SHL EBX,6       ; 1
ADD ECX,EBX     ; 2 (EBX modified prev. instruction)


-- Barubary


Follow-Ups: