Setc instruction

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
AdrianLapaj
Posts: 2
Joined: Wed Sep 07, 2005 11:00 pm

Setc instruction

Post 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. ;)
Osbios
Member
Member
Posts: 116
Joined: Fri Jun 10, 2005 11:00 pm

Re: Setc instruction

Post 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
dw 0xAA55
Post Reply