* better
[mascara-docs.git] / hw / i386.reference / SETcc.htm
blob1b7d36a8d38e260de8a27eb96bb16b86cb0e2402
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
2 <HTML>
3 <HEAD>
4 <TITLE>80386 Programmer's Reference Manual -- Opcode SETcc</TITLE>
5 </HEAD>
6 <BODY>
7 <B>up:</B> <A HREF="c17.htm">
8 Chapter 17 -- 80386 Instruction Set</A><BR>
9 <B>prev:</B><A HREF="SCAS.htm"> SCAS/SCASB/SCASW/SCASD Compare String Data</A><BR>
10 <B>next:</B><A HREF="SGDT.htm"> SGDT/SIDT Store Global/Interrupt Descriptor Table Register</A>
11 <P>
12 <HR>
13 <P>
14 <H1>SETcc -- Byte Set on Condition</H1>
17 <PRE>
18 Opcode Instruction Clocks Description
20 0F 97 SETA r/m8 4/5 Set byte if above (CF=0 and ZF=0)
21 0F 93 SETAE r/m8 4/5 Set byte if above or equal (CF=0)
22 0F 92 SETB r/m8 4/5 Set byte if below (CF=1)
23 0F 96 SETBE r/m8 4/5 Set byte if below or equal (CF=1 or (ZF=1)
24 0F 92 SETC r/m8 4/5 Set if carry (CF=1)
25 0F 94 SETE r/m8 4/5 Set byte if equal (ZF=1)
26 0F 9F SETG r/m8 4/5 Set byte if greater (ZF=0 or SF=OF)
27 0F 9D SETGE r/m8 4/5 Set byte if greater or equal (SF=OF)
28 0F 9C SETL r/m8 4/5 Set byte if less (SF<>OF)
29 0F 9E SETLE r/m8 4/5 Set byte if less or equal (ZF=1 and
30 SF<>OF)
31 0F 96 SETNA r/m8 4/5 Set byte if not above (CF=1)
32 0F 92 SETNAE r/m8 4/5 Set byte if not above or equal (CF=1)
33 0F 93 SETNB r/m8 4/5 Set byte if not below (CF=0)
34 0F 97 SETNBE r/m8 4/5 Set byte if not below or equal (CF=0 and
35 ZF=0)
36 0F 93 SETNC r/m8 4/5 Set byte if not carry (CF=0)
37 0F 95 SETNE r/m8 4/5 Set byte if not equal (ZF=0)
38 0F 9E SETNG r/m8 4/5 Set byte if not greater (ZF=1 or SF<>OF)
39 0F 9C SETNGE r/m8 4/5 Set if not greater or equal (SF<>OF)
40 0F 9D SETNL r/m8 4/5 Set byte if not less (SF=OF)
41 0F 9F SETNLE r/m8 4/5 Set byte if not less or equal (ZF=1 and
42 SF<>OF)
43 0F 91 SETNO r/m8 4/5 Set byte if not overflow (OF=0)
44 0F 9B SETNP r/m8 4/5 Set byte if not parity (PF=0)
45 0F 99 SETNS r/m8 4/5 Set byte if not sign (SF=0)
46 0F 95 SETNZ r/m8 4/5 Set byte if not zero (ZF=0)
47 0F 90 SETO r/m8 4/5 Set byte if overflow (OF=1)
48 0F 9A SETP r/m8 4/5 Set byte if parity (PF=1)
49 0F 9A SETPE r/m8 4/5 Set byte if parity even (PF=1)
50 0F 9B SETPO r/m8 4/5 Set byte if parity odd (PF=0)
51 0F 98 SETS r/m8 4/5 Set byte if sign (SF=1)
52 0F 94 SETZ r/m8 4/5 Set byte if zero (ZF=1)
53 </PRE>
55 <H2>Operation</H2>
57 <PRE>
58 IF condition THEN r/m8 := 1 ELSE r/m8 := 0; FI;
59 </PRE>
61 <H2>Description</H2>
63 SETcc stores a byte at the destination specified by the effective address
64 or register if the condition is met, or a 0 byte if the condition is not
65 met.
67 <H2>Flags Affected</H2>
69 None
71 <H2>Protected Mode Exceptions</H2>
73 #GP(0) if the result is in a non-writable segment; #GP(0) for an illegal
74 memory operand effective address in the CS, DS, ES, FS, or GS segments;
75 #SS(0) for an illegal address in the SS segment; #PF(fault-code) for a page
76 fault
78 <H2>Real Address Mode Exceptions</H2>
80 Interrupt 13 if any part of the operand would lie outside of the effective
81 address space from 0 to 0FFFFH
83 <H2>Virtual 8086 Mode Exceptions</H2>
85 Same exceptions as in Real Address Mode; #PF(fault-code) for a page
86 fault
89 <P>
90 <HR>
91 <P>
92 <B>up:</B> <A HREF="c17.htm">
93 Chapter 17 -- 80386 Instruction Set</A><BR>
94 <B>prev:</B><A HREF="SCAS.htm"> SCAS/SCASB/SCASW/SCASD Compare String Data</A><BR>
95 <B>next:</B><A HREF="SGDT.htm"> SGDT/SIDT Store Global/Interrupt Descriptor Table Register</A>
96 </BODY>