Page 1 of 1

Setc instruction

Posted: Tue Sep 20, 2005 11:00 pm
by AdrianLapaj
HELLo :P I need some infos about setc assembly instruction, but i can't find anything:( Is anyone has sth about this **** ??

P.S. Sorry for my english. ;)

Re: Setc instruction

Posted: Tue Sep 20, 2005 11:00 pm
by Osbios
SETxx works like Jxx jump. But it dosn't jump, it set a bit. ;)

That what NASM docs say:
Set Register from Condition

SETcc r/m8 ; 0F 90+cc /2 [386]

SETcc sets the given 8-bit operand to zero if its condition is not satisfied, and to 1 if it is.
For example:

Code: Select all

cmp ax,bx
je target;IF ax=bx then JMP to TARGET 
target:

Code: Select all

cmp ax,bx
sete byte[target];IF ax=bx then target=1 else target=0

Code: Select all

cmp ax,bx
setne al;IF ax<>bx then al=1 else al=0