3 questions... optimization suggestions... and alignment check flag...
From: Bx.C (invalid-email-address_at_invalid.shiragajin)
Date: 02/25/04
- Next message: The Half A Wannabee: "Re: Even brute force was better then Delphi !"
- Previous message: Bx.C: "Re: numbers written in ascii... looking for all common (and some uncommon) forms...."
- Next in thread: wolfgang kern: "Re: 3 questions... optimization suggestions... and alignment check flag..."
- Reply: wolfgang kern: "Re: 3 questions... optimization suggestions... and alignment check flag..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 24 Feb 2004 23:04:40 -0600
1) trying to find the fastest way of displaying an 8-bit unsigned, in hex...
restriction: limit to 16-bit code
i'm currently thinking this would be fastest:
MOV AL,[SI]
MOV CL,AL
SHR AL,004H
AND CL,00FH
CMP AL,00AH
JB $+2+3 ; jumps past next instruction
ADD AL,007H
CMP CL,00AH
JB $+2+3 ; jumps past next instruction
ADD CL,007H
MOV AH,CL
ADD AX,03030H
MOV [DI],AX
except... for some reason i keep telling myself i could start out and end
this snippet a little better than this... is it right for me to assume that
using CL would be faster than using AH, since i'm already doing operations
on AL? are there any suggestions that anyone can give me to speed up this
snippet even more, while still limiting to 16-bit code? (please, no
complaints about the 16-bit code restriction).
---------------------------------------------------
2) considering the snippet of code above,... if DI is an odd value,.. then
i'd suffer a slight penalty at the end of the code snippet.. correct??
would it be faster to replace the last three lines with these?
ADD AL,030H
ADD CL,030H
MOV [DI],AL
MOV [DI+000H],CL
would that be faster only if DI is odd? or would it always be slower?
---------------------------------------------------
Who uses the alignment check flag in the eflags?
What usefulness does it have?
When might I wish to use it?
Where would I use it?
Why would I use it?
How would I use it?
(i know what it does,.. i just want to know why anyone would have a use for
it)
- Next message: The Half A Wannabee: "Re: Even brute force was better then Delphi !"
- Previous message: Bx.C: "Re: numbers written in ascii... looking for all common (and some uncommon) forms...."
- Next in thread: wolfgang kern: "Re: 3 questions... optimization suggestions... and alignment check flag..."
- Reply: wolfgang kern: "Re: 3 questions... optimization suggestions... and alignment check flag..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|