Assembler Programming Topics

These topics contain information about assembler programming and the ISA for x86 processors up to the Intel 486.

For an overview of the CPU registers, refer to the Intel 8086 Family Architecture topic.

In the instruction topics, you will find clock counts for each CPU. The Instruction Clock Cycle Calculation topic describes the calculation in more detail.

If you are using MASM, you may find useful to check the MASM Command Line Options and the MASM Directives topics.

The Memory Model Programming & Segment Information topic describes the memory models supported by most MS-DOS assemblers.

Finally, for information on the flags register and the machine status word (286+ only), check the FLAGS and MSW topics respectively.

x86 Instruction Set

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

A

AAA Ascii Adjust for Addition
AAD Ascii Adjust for Division
AAM Ascii Adjust for Multiplication
AAS Ascii Adjust for Subtraction
ADC Add With Carry
ADD Arithmetic Addition
AND Logical And
ARPL Adjusted Requested Privilege Level of Selector

B

BOUND Array Index Bound Check (80188+)
BSF Bit Scan Forward (386+ only)
BSR Bit Scan Reverse (386+ only)
BSWAP Byte Swap (486+ only)
BT Bit Test (386+ only)
BTC Bit Test with Compliment (386+ only)
BTR Bit Test with Reset (386+ only)
BTS Bit Test and Set (386+ only)

C

CALL Procedure Call
CBW Convert Byte to Word
CDQ Convert Double to Quad (386+ only)
CLC Clear Carry
CLD Clear Direction Flag
CLI Clear Interrupt Flag (disable)
CLTS Clear Task Switched Flag (286+ privileged)
CMC Complement Carry Flag
CMP Compare
CMPS Compare String (Byte, Word or Doubleword)
CMPXCHG Compare and Exchange
CWD Convert Word to Doubleword
CWDE Convert Word to Extended Doubleword (386+ only)

D

DAA Decimal Adjust for Addition
DAS Decimal Adjust for Subtraction
DEC Decrement
DIV Divide

E

ENTER Make Stack Frame (80188+)
ESC Escape

H

HLT Halt CPU

I

IDIV Signed Integer Division
IMUL Signed Multiply
IN Input Byte or Word From Port
INC Increment
INS Input String from Port (80188+)
INT Interrupt
INTO Interrupt on Overflow
INVD Invalidate Cache (486+ only)
INVLPG Invalidate Translation Look-Aside Buffer Entry (486+ only)
IRET/IRETD Interrupt Return

J

Check the Jump Instructions Table topic for a summary of the various jump instructions.

JA/JNBE Jump Above / Jump Not Below or Equal
JAE/JNB Jump Above or Equal / Jump on Not Below
JB/JNAE Jump Below / Jump Not Above or Equal
JBE/JNA Jump Below or Equal / Jump Not Above
JC Jump on Carry
JCXZ/JECXZ Jump if Register (E)CX is Zero
JE/JZ Jump Equal / Jump Zero
JG/JNLE Jump Greater / Jump Not Less or Equal
JGE/JNL Jump Greater or Equal / Jump Not Less
JL/JNGE Jump Less / Jump Not Greater or Equal
JLE/JNG Jump Less or Equal / Jump Not Greater
JMP Unconditional Jump
JNC Jump Not Carry
JNE/JNZ Jump Not Equal / Jump Not Zero
JNO Jump Not Overflow
JNS Jump Not Signed
JNP/JPO Jump Not Parity / Jump Parity Odd
JO Jump on Overflow
JP/JPE Jump on Parity / Jump on Parity Even
JS Jump Signed

L

LAHF Load Register AH From Flags
LAR Load Access Rights (286+ protected)
LDS Load Pointer Using DS
LEA Load Effective Address
LEAVE Restore Stack for Procedure Exit (80188+)
LES Load Pointer Using ES
LFS Load Pointer Using FS (386+ only)
LGDT Load Global Descriptor Table (286+ privileged)
LIDT Load Interrupt Descriptor Table (286+ privileged)
LGS Load Pointer Using GS (386+ only)
LLDT Load Local Descriptor Table (286+ privileged)
LMSW Load Machine Status Word (286+ privileged)
LOCK Lock Bus
LODS Load String (Byte, Word or Double)
LOOP Decrement CX and Loop if CX Not Zero
LOOPE/LOOPZ Loop While Equal / Loop While Zero
LOOPNZ/LOOPNE Loop While Not Zero / Loop While Not Equal
LSL Load Segment limit (286+ protected)
LSS Load Pointer Using SS (386+ only)
LTR Load Task Register (286+ privileged)

M

MOV Move Byte or Word
MOVS Move String (Byte or Word)
MOVSX Move with Sign Extend (386+ only)
MOVZX Move with Zero Extend (386+ only)
MUL Unsigned Multiply

N

NEG Two's Complement Negation
NOP No Operation (90h)
NOT One's Compliment Negation (Logical NOT)

O

OR Inclusive Logical OR
OUT Output Data to Port
OUTS Output String to Port (80188+ only)

P

POP Pop Word off Stack
POPA/POPAD Pop All Registers onto Stack (80188+ only)
POPF/POPFD Pop Flags off Stack
PUSH Push Word onto Stack
PUSHA/PUSHAD Push All Registers onto Stack (80188+ only)
PUSHF/PUSHFD Push Flags onto Stack

R

RCL Rotate Through Carry Left
RCR Rotate Through Carry Right
REP Repeat String Operation
REPE/REPZ Repeat Equal / Repeat Zero
REPNE/REPNZ Repeat Not Equal / Repeat Not Zero
RET/RETF Return From Procedure
ROL Rotate Left
ROR Rotate Right

S

SAHF Store AH Register into FLAGS
SAL/SHL Shift Arithmetic Left / Shift Logical Left
SAR Shift Arithmetic Right
SBB Subtract with Borrow
SCAS Scan String (Byte, Word or Doubleword)
SETAE/SETNB Set if Above or Equal / Set if Not Below
SETB/SETNAE Set if Below / Set if Not Above or Equal
SETBE/SETNA Set if Below or Equal / Set if Not Above
SETE/SETZ Set if Equal / Set if Zero (386+ only)
SETNE/SETNZ Set if Not Equal / Set if Not Zero (386+ only)
SETL/SETNGE Set if Less / Set if Not Greater or Equal
SETGE/SETNL Set if Greater or Equal / Set if Not Less
SETLE/SETNG Set if Less or Equal / Set if Not greater or Equal
SETG/SETNLE Set if Greater / Set if Not Less or Equal
SETS Set if Signed (386+ only)
SETNS Set if Not Signed (386+ only)
SETC Set if Carry (386+ only)
SETNC Set if Not Carry (386+ only)
SETO Set if Overflow (386+ only)
SETNO Set if Not Overflow (386+ only)
SETP/SETPE Set if Parity / Set if Parity Even (386+ only)
SETNP/SETPO Set if No Parity / Set if Parity Odd (386+ only)
SGDT Store Global Descriptor Table (286+ privileged)
SIDT Store Interrupt Descriptor Table (286+ privileged)
SHR Shift Logical Right
SHLD/SHRD Double Precision Shift (386+ only)
SLDT Store Local Descriptor Table (286+ privileged)
SMSW Store Machine Status Word (286+ privileged)
STC Set Carry
STD Set Direction Flag
STI Set Interrupt Flag (Enable Interrupts)
STOS Store String (Byte, Word or Doubleword)
STR Store Task Register (286+ privileged)
SUB Subtract

T

TEST Test For Bit Pattern

V

VERR Verify Read (286+ protected)
VERW Verify Write (286+ protected)

W

WAIT/FWAIT Event Wait
WBINVD Write-Back and Invalidate Cache

X

XCHG Exchange
XLAT/XLATB Translate
XOR Exclusive OR