SAHF - Store AH Register into FLAGS
Usage: SAHF
Modifies Flags: AF CF PF SF ZF
Transfers bits 0-7 of AH into the Flags Register. This includes AF, CF, PF, SF and ZF.
Clocks | ||||
---|---|---|---|---|
operands | 286 | 386 | 486 | Size Bytes |
none | 2 | 3 | 2 | 1 |
SAL/SHL - Shift Arithmetic Left / Shift Logical Left
Usage: SAL dest,count
SHL dest,count
Modifies Flags: CF OF PF SF ZF (AF undefined)
Shifts the destination left by "count" bits with zeroes shifted in on right. The Carry Flag contains the last bit shifted out.
Clocks | ||||
---|---|---|---|---|
operands | 286 | 386 | 486 | Size Bytes |
reg,1 | 2 | 3 | 3 | 2 |
mem,1 | 7 | 7 | 4 | 2-4 |
reg,CL | 5+n | 3 | 3 | 2 |
mem,CL | 8+n | 7 | 4 | 2-4 |
reg,immed8 | 5+n | 3 | 2 | 3 |
mem,immed8 | 8+n | 7 | 4 | 3-5 |
SAR - Shift Arithmetic Right
Usage: SAR dest,count
Modifies Flags: CF OF PF SF ZF (AF undefined)
Shifts the destination right by "count" bits with the current sign bit replicated in the leftmost bit. The Carry Flag contains the last bit shifted out.
Clocks | ||||
---|---|---|---|---|
operands | 286 | 386 | 486 | Size Bytes |
reg,1 | 2 | 3 | 3 | 2 |
mem,1 | 7 | 7 | 4 | 2-4 |
reg,CL | 5+n | 3 | 3 | 2 |
mem,CL | 8+n | 7 | 4 | 2-4 |
reg,immed8 | 5+n | 3 | 2 | 3 |
mem,immed8 | 8+n | 7 | 4 | 3-5 |
SBB - Subtract with Borrow/Carry
Usage: SBB dest,src
Modifies Flags: AF CF OF PF SF ZF
Subtracts the source from the destination, and subtracts 1 extra if the Carry Flag is set. Results are returned in "dest".
Clocks | ||||
---|---|---|---|---|
operands | 286 | 386 | 486 | Size Bytes |
reg,reg | 2 | 2 | 1 | 2 |
mem,reg | 7 | 6 | 3 | 2-4 |
reg,mem | 7 | 7 | 2 | 2-4 |
reg,immed | 3 | 2 | 1 | 3-4 |
mem,immed | 7 | 7 | 3 | 3-6 |
accum,immed | 3 | 2 | 1 | 2-3 |
SCAS - Scan String (Byte, Word or Doubleword)
Usage: SCAS string
SCASB
SCASW
SCASD (386+)
Modifies Flags: AF CF OF PF SF ZF
Compares value at ES:DI (even if operand is specified) from the accumulator and sets the flags similar to a subtraction. DI is incremented/decremented based on the instruction format (or operand size) and the state of the Direction Flag. Use with REP prefixes.
Clocks | ||||
---|---|---|---|---|
operands | 286 | 386 | 486 | Size Bytes |
string | 7 | 7 | 6 | 1 |
SETAE/SETNB - Set if Above or Equal / Set if Not Below (386+)
Usage: SETAE dest
SETNB dest (unsigned, 386+)
Modifies Flags: None
Sets the byte in the operand to 1 if the Carry Flag is clear otherwise sets the operand to 0.
Clocks | ||||
---|---|---|---|---|
operands | 286 | 386 | 486 | Size Bytes |
reg8 | 4 | 3 | 3 | |
mem8 | 5 | 4 | 3 |
SETB/SETNAE - Set if Below / Set if Not Above or Equal (386+)
Usage: SETB dest
SETNAE dest (unsigned, 386+)
Modifies Flags: None
Sets the byte in the operand to 1 if the Carry Flag is set otherwise sets the operand to 0.
Clocks | ||||
---|---|---|---|---|
operands | 286 | 386 | 486 | Size Bytes |
reg8 | 4 | 3 | 3 | |
mem8 | 5 | 4 | 3 |
SETBE/SETNA - Set if Below or Equal / Set if Not Above (386+)
Usage: SETBE dest
SETNA dest (unsigned, 386+)
Modifies Flags: None
Sets the byte in the operand to 1 if the Carry Flag or the Zero Flag is set, otherwise sets the operand to 0.
Clocks | ||||
---|---|---|---|---|
operands | 286 | 386 | 486 | Size Bytes |
reg8 | 4 | 3 | 3 | |
mem8 | 5 | 4 | 3 |
SETE/SETZ - Set if Equal / Set if Zero (386+)
Usage: SETE dest
SETZ dest
Modifies Flags: None
Sets the byte in the operand to 1 if the Zero Flag is set, otherwise sets the operand to 0.
Clocks | ||||
---|---|---|---|---|
operands | 286 | 386 | 486 | Size Bytes |
reg8 | 4 | 3 | 3 | |
mem8 | 5 | 4 | 3 |
SETNE/SETNZ - Set if Not Equal / Set if Not Zero (386+)
Usage: SETNE dest
SETNZ dest
Modifies Flags: None
Sets the byte in the operand to 1 if the Zero Flag is clear, otherwise sets the operand to 0.
Clocks | ||||
---|---|---|---|---|
operands | 286 | 386 | 486 | Size Bytes |
reg8 | 4 | 3 | 3 | |
mem8 | 5 | 4 | 3 |
SETL/SETNGE - Set if Less / Set if Not Greater or Equal (386+)
Usage: SETL dest
SETNGE dest (signed, 386+)
Modifies Flags: None
Clocks | ||||
---|---|---|---|---|
operands | 286 | 386 | 486 | Size Bytes |
reg8 | 4 | 3 | 3 | |
mem8 | 5 | 4 | 3 |
SETGE/SETNL - Set if Greater or Equal / Set if Not Less (386+)
Usage: SETGE dest
SETNL dest (signed, 386+)
Modifies Flags: None
Sets the byte in the operand to 1 if the Sign Flag equals the Overflow Flag, otherwise sets the operand to 0.
Clocks | ||||
---|---|---|---|---|
operands | 286 | 386 | 486 | Size Bytes |
reg8 | 4 | 3 | 3 | |
mem8 | 5 | 4 | 3 |
SETLE/SETNG - Set if Less or Equal / Set if Not greater or Equal (386+)
Usage: SETLE dest
SETNG dest (signed, 386+)
Modifies Flags: None
Sets the byte in the operand to 1 if the Zero Flag is set or the Sign Flag is not equal to the Overflow Flag, otherwise sets the operand to 0.
Clocks | ||||
---|---|---|---|---|
operands | 286 | 386 | 486 | Size Bytes |
reg8 | 4 | 3 | 3 | |
mem8 | 5 | 4 | 3 |
SETG/SETNLE - Set if Greater / Set if Not Less or Equal (386+)
Usage: SETG dest
SETNLE dest (signed, 386+)
Modifies Flags: None
Sets the byte in the operand to 1 if the Zero Flag is clear or the Sign Flag equals to the Overflow Flag, otherwise sets the operand to 0.
Clocks | ||||
---|---|---|---|---|
operands | 286 | 386 | 486 | Size Bytes |
reg8 | 4 | 3 | 3 | |
mem8 | 5 | 4 | 3 |
SETS - Set if Signed (386+)
Usage: SETS dest
Modifies Flags: None
Sets the byte in the operand to 1 if the Sign Flag is set, otherwise sets the operand to 0.
Clocks | ||||
---|---|---|---|---|
operands | 286 | 386 | 486 | Size Bytes |
reg8 | 4 | 3 | 3 | |
mem8 | 5 | 4 | 3 |
SETNS - Set if Not Signed (386+)
Usage: SETNS dest
Modifies Flags: None
Sets the byte in the operand to 1 if the Sign Flag is clear, otherwise sets the operand to 0.
Clocks | ||||
---|---|---|---|---|
operands | 286 | 386 | 486 | Size Bytes |
reg8 | 4 | 3 | 3 | |
mem8 | 5 | 4 | 3 |
SETC - Set if Carry (386+)
Usage: SETC dest
Modifies Flags: None
Sets the byte in the operand to 1 if the Carry Flag is set, otherwise sets the operand to 0.
Clocks | ||||
---|---|---|---|---|
operands | 286 | 386 | 486 | Size Bytes |
reg8 | 4 | 3 | 3 | |
mem8 | 5 | 4 | 3 |
SETNC - Set if Not Carry (386+)
Usage: SETNC dest
Modifies Flags: None
Sets the byte in the operand to 1 if the Carry Flag is clear, otherwise sets the operand to 0.
Clocks | ||||
---|---|---|---|---|
operands | 286 | 386 | 486 | Size Bytes |
reg8 | 4 | 3 | 3 | |
mem8 | 5 | 4 | 3 |
SETO - Set if Overflow (386+)
Usage: SETO dest
Modifies Flags: None
Sets the byte in the operand to 1 if the Overflow Flag is set, otherwise sets the operand to 0.
Clocks | ||||
---|---|---|---|---|
operands | 286 | 386 | 486 | Size Bytes |
reg8 | 4 | 3 | 3 | |
mem8 | 5 | 4 | 3 |
SETNO - Set if Not Overflow (386+)
Usage: SETNO dest
Modifies Flags: None
Sets the byte in the operand to 1 if the Overflow Flag is clear, otherwise sets the operand to 0.
Clocks | ||||
---|---|---|---|---|
operands | 286 | 386 | 486 | Size Bytes |
reg8 | 4 | 3 | 3 | |
mem8 | 5 | 4 | 3 |
SETP/SETPE - Set if Parity / Set if Parity Even (386+)
Usage: SETP dest
SETPE dest
Modifies Flags: None
Sets the byte in the operand to 1 if the Parity Flag is set, otherwise sets the operand to 0.
Clocks | ||||
---|---|---|---|---|
operands | 286 | 386 | 486 | Size Bytes |
reg8 | 4 | 3 | 3 | |
mem8 | 5 | 4 | 3 |
SETNP/SETPO - Set if No Parity / Set if Parity Odd (386+)
Usage: SETNP dest
SETPO dest
Modifies Flags: None
Sets the byte in the operand to 1 if the Parity Flag is clear, otherwise sets the operand to 0.
Clocks | ||||
---|---|---|---|---|
operands | 286 | 386 | 486 | Size Bytes |
reg8 | 4 | 3 | 3 | |
mem8 | 5 | 4 | 3 |
SGDT - Store Global Descriptor Table (286+ privileged)
Usage: SGDT dest
Modifies Flags: None
Stores the Global Descriptor Table (GDT) Register into the specified operand.
Clocks | ||||
---|---|---|---|---|
operands | 286 | 386 | 486 | Size Bytes |
mem64 | 11 | 9 | 10 | 5 |
SIDT - Store Interrupt Descriptor Table (286+ privileged)
Usage: SIDT dest
Modifies Flags: None
Stores the Interrupt Descriptor Table (IDT) Register into the specified operand.
Clocks | ||||
---|---|---|---|---|
operands | 286 | 386 | 486 | Size Bytes |
mem64 | 12 | 9 | 10 | 5 |
SHR - Shift Logical Right
Usage: SHR dest,count
Modifies Flags: CF OF PF SF ZF (AF undefined)
Shifts the destination right by "count" bits with zeroes shifted in on the left. The Carry Flag contains the last bit shifted out.
Clocks | ||||
---|---|---|---|---|
operands | 286 | 386 | 486 | Size Bytes |
reg,1 | 2 | 3 | 3 | 2 |
mem,1 | 7 | 7 | 4 | 2-4 |
reg,CL | 5+n | 3 | 3 | 2 |
mem,CL | 8+n | 7 | 4 | 2-4 |
reg,immed8 | 5+n | 3 | 2 | 3 |
mem,immed8 | 8+n | 7 | 4 | 3-5 |
SHLD/SHRD - Double Precision Shift (386+)
Usage: SHLD dest,src,count
SHRD dest,src,count
Modifies Flags: CF PF SF ZF (OF,AF undefined)
SHLD shifts "dest" to the left "count" times and the bit positions opened are filled with the most significant bits of "src". SHRD shifts "dest" to the right "count" times and the bit positions opened are filled with the least significant bits of the second operand. Only the 5 lower bits of "count" are used.
Clocks | ||||
---|---|---|---|---|
operands | 286 | 386 | 486 | Size Bytes |
reg16,reg16,immed8 | 3 | 2 | 4 | |
reg32,reg32,immed8 | 3 | 2 | 4 | |
mem16,reg16,immed8 | 7 | 3 | 6 | |
mem32,reg32,immed8 | 7 | 3 | 6 | |
reg16,reg16,CL | 3 | 3 | 3 | |
reg32,reg32,CL | 3 | 3 | 3 | |
mem16,reg16,CL | 7 | 4 | 5 | |
mem32,reg32,CL | 7 | 4 | 5 |
SLDT - Store Local Descriptor Table (286+ privileged)
Usage: SLDT dest
Modifies Flags: none
Stores the Local Descriptor Table (LDT) Register into the specified operand.
Clocks | ||||
---|---|---|---|---|
operands | 286 | 386 | 486 | Size Bytes |
reg16 | 2 | 2 | 2 | 3 |
mem16 | 2 | 2 | 3 | 5 |
SMSW - Store Machine Status Word (286+ privileged)
Usage: SMSW dest
Modifies Flags: none
Store Machine Status Word (MSW) into "dest".
Clocks | ||||
---|---|---|---|---|
operands | 286 | 386 | 486 | Size Bytes |
reg16 | 2 | 1 | 2 | 3 |
mem16 | 3 | 3 | 3 | 5 |
STC - Set Carry
Usage: STC
Modifies Flags: CF
Sets the Carry Flag to 1.
Clocks | ||||
---|---|---|---|---|
operands | 286 | 386 | 486 | Size Bytes |
none | 2 | 2 | 2 | 1 |
STD - Set Direction Flag
Usage: STD
Modifies Flags: DF
Sets the Direction Flag to 1 causing string instructions to auto-decrement SI and DI instead of auto-increment.
Clocks | ||||
---|---|---|---|---|
operands | 286 | 386 | 486 | Size Bytes |
none | 2 | 2 | 2 | 1 |
STI - Set Interrupt Flag (Enable Interrupts)
Usage: STI
Modifies Flags: IF
Sets the Interrupt Flag to 1, which enables recognition of all hardware interrupts. If an interrupt is generated by a hardware device, an End of Interrupt (EOI) must also be issued to enable other hardware interrupts of the same or lower priority.
Clocks | ||||
---|---|---|---|---|
operands | 286 | 386 | 486 | Size Bytes |
none | 2 | 2 | 5 | 1 |
STOS - Store String (Byte, Word or Doubleword)
Usage: STOS dest
STOSB dest
STOSW dest
STOSD dest
Modifies Flags: none
Stores value in accumulator to location at ES:(E)DI (even if operand is given). (E)DI is incremented/decremented based on the size of the operand (or instruction format) and the state of the Direction Flag. Use with REP prefixes.
Clocks | ||||
---|---|---|---|---|
operands | 286 | 386 | 486 | Size Bytes |
dest | 3 | 4 | 5 | 1 |
STR - Store Task Register (286+ privileged)
Usage: STR dest
Modifies Flags: None
Stores the current Task Register to the specified operand.
Clocks | ||||
---|---|---|---|---|
operands | 286 | 386 | 486 | Size Bytes |
reg16 | 2 | 2 | 2 | 3 |
mem16 | 3 | 2 | 3 | 5 |
SUB - Subtract
Usage: SUB dest,src
Modifies Flags: AF CF OF PF SF ZF
The source is subtracted from the destination and the result is stored in the destination.
Clocks | ||||
---|---|---|---|---|
operands | 286 | 386 | 486 | Size Bytes |
reg,reg | 2 | 2 | 1 | 2 |
mem,reg | 7 | 6 | 3 | 2-4 |
reg,mem | 7 | 7 | 2 | 2-4 |
reg,immed | 3 | 2 | 1 | 3-4 |
mem,immed | 7 | 7 | 3 | 3-6 |
accum,immed | 3 | 2 | 1 | 2-3 |
[ TOC | Previous | NeXt | Winston's page ]