Re: Clever ways to hide a compare




Keyser Soze wrote:

| Examples to compare AX with DX on an x86:
[...]

AND, OR and XOR will always clear the Carry-flag on my x86 CPUs.


in need for a weird comparision ?
I've already seen one in 'sold code' (must be the result of HLL):

Proc_Compare <w1,w2>
push bp
mov bp,sp
mov ax,[bp+2]
sub ax,[bp+4]
mov sp,bp
pop bp
ret 4

is it weird enough by just using obligatory taught redundance ?
:)
__
wolfgang


.



Relevant Pages

  • Re: I need speed! Byte-for-byte comparing ...
    ... so we have the worst-case situation and we have to compare to the end ... xor(eax, eax); ... mov(16*1024*1024, ecx); ... mov(edx, (type dword time1)); ...
    (alt.lang.asm)
  • Re: itoa assembly version
    ... mov byte ptr ds:, dl ... "Divide Overflow" again? ... could compare ax against zero but I haven't learn it yet. ...
    (alt.lang.asm)