You are on page 1of 6

8/17/2011

Instruction Set

8086/8088 Instruction sets

OP Code Operational code, the code

that the machine understand and indicates what the computer will do. In

Mnemonics it is abbreviated Operand indicates the information

the form of Mnemonics instruction

Engr. Nio E. Merencilla

needed by the instruction in carrying out its task. An operand may contain a datum, address of the datum, or other information pertaining to the data to be acted on by the instruction.

Example

Classification of 8086/8088 Instruction Set


Operand

MOV AX , BX
OP Code

Data Transfer Instructions Arithmetic Instructions Bit Manipulation Instructions String Instructions Program Transfer Instructions Processor Control Instructions

Where: MOV is the Mnemonic for MOVE AX & BX is the Operand AX is the Destination operand BX is the Source operand

Data Transfer Instructions


These instructions are used to

MOV
Mnemonics for MOVE Move the content to/from

move data among registers, memory and the outside world. Also some instructions directly manipulate the stacks while other maybe used to alter the flags.

register/memory Syntax: MOV Destination , Source Example MOV AL,BL

8/17/2011

PUSH
Mnemonic for Push word to stack This instruction is used to save the

Stack
It is a collection of memory pointed

content of the register so that it can be used for other purpose. The saved data maybe copied into another register or written into memory called STACK

to by the Stack Pointer Register and Stack Segment Register. When we used to write data into the Stack we use this command PUSH Syntax: PUSH Source

Copy two bytes of data from register

or memory into the stack memory and then decrement SP by 2

POP
Mnemonic for POP word to stack This is the reverse of the PUSH Syntax:

POP Destination

8/17/2011

Retrieve two bytes of data from

stack memory and place it into a 16bit register or two memory locations then it increments SP by 2.

IN
Mnemonic for INPUT byte/word

from I/O Port.


This instruction is used to input

value from the I/O ports.


Syntax:

IN Accumulator , Port #

Transfers data from an external input

device with port address specified by the instruction to accumulator (AL, AX or EAX).

OUT
Mnemonic for OUTPUT

byte/word to I/O Port. This is the complement of the IN instruction. Syntax: OUT Port #, Accumulator

Transfers data from accumulator (AL,

AX or EAX) to an external output device with port address specified by the instruction.

LEA
Mnemonics for Load Effective

Address
This instruction is used to load the

offset of the source memory operand into one of the processors registers Syntax: LEA Destination , Source

8/17/2011

Loads a 16-bit register with offset

or effective address specified in the instruction.

PUSHF
Mnemonics for Push Flags onto

Stack
This instructions copy the

content of the Flag register into the Stack register. Syntax: PUSHF

POPF
Mnemonics for Pop Flags onto

XCHG
Mnemonics for Exchange data. This instruction is used to swap the

Stack This is the reverse operation of PUSHF Syntax: POPF

content of 8,16 or 32 bit operand.

One of the register must be a

processor register (excluding segment register). The other operand maybe a register or memory location

If the memory location is used as an

operand it is assumed to be within a data segment. Syntax: XCHG Destination , Source

8/17/2011

XLAT
Mnemonics for Translate Table. This instruction is used translate

It is used to translate a byte from one

one binary value to another. Syntax: XLAT

code to another code. XLAT replaces a byte in the AL register with a byte pointed to by BX in a lookup table in memory. Before the XLAT instruction can be executed, the lookup table containing values for the new code must be put in memory, andt he offset of the starting address of the lookup table must be loaded in BX. The code byte to be translated is put in AL.

LDS / LES
Mnemonics for Load pointer to DS / The 2nd 2 byte are copied into the

ES This instruction is used to load the two-16 bit register from a 4-byte block of memory The 1st 2 byte are copied into the register specified in the destination operand of the instruction

DS Syntax: LDS Destination , Source LES Destination , Source

Load 16-bit register and DS or ES

with words from four memory pointed by [mem]. Copies a word from two memory locations into 16-bit register specified in the instruction. It then copies a word from the next two memory locations into the DS or ES.

LAHF
Mnemonic for Load AH from Flag This command enable to load the

content of the flag register to the higher byte of the Accumulator Syntax: LAHF

8/17/2011

SAHF
This is one way to determine the

status of the flag by copying the LSByte of the flag to AH

Mnemonic for Store AH into Flag. This instruction is used to load a

new set of flags into the flag register by copying the content of AH register into the LSByte of the flag Syntax: SAHF

End

You might also like