Professional Documents
Culture Documents
TO THE
INSTRUCTION SET OF
8088 MICROPROCESSOR
1 PNEC
Instruction Set of 8088 MP
8086/8088 M.Ps Instruction Set
Divided into following Categories;
i) Data Movement Instructions
ii) Arithmetic & Logic Instructions
iii) Shift & Rotate Instructions
iv) Program Transfer Instructions
v) String Instructions
2 PNEC
Instruction Set of 8088 MP
Examples:
XCHG Instructions
3 PNEC
Instruction Set of 8088 MP
Examples:
4 PNEC
Instruction Set of 8088 MP
Examples:
5 PNEC
Instruction Set of 8088 MP
Examples:
6 PNEC
Instruction Set of 8088 MP
String Instructions:
Examples:
7 PNEC
Instruction Set of 8088 MP
Description of some Data Movement Commands: MOV Command
8 PNEC
Instruction Set of 8088 MP
Description of some Data Movement Commands: OUT Command
10 PNEC
Instruction Set of 8088 MP
Description
DIV commands:
Here Dividend is kept in AX register. After division Quotient goes in
AL & Remainder goes in AH
Example: DIV BL; AX / BL => Quotient = AL, Remainder = AH
11 PNEC
Instruction Set of 8088 MP
Description
Logic Commands
Examples:
AND AX, BX
OR CX, DX
NOT BH
XOR BL, DH
If AX = FFFFh, BX = 00AAh, i.e
AX = 1111 1111 1111 1111
BX = 0000 0000 1010 1010 => AX = 0000 0000 1010 1010h
12 PNEC
Instruction Set of 8088 MP
Logic Commands
Examples:
If AX = FFFFh, BX = 00AAh, i.e
AX = 1111 1111 1111 1111
BX = 0000 0000 1010 1010
XOR AH, BL
AH = 1111 1111
BL = 1010 1010
Þ AH = 0101 0101
Þ BL = 10101010
13 PNEC
Instruction Set of 8088 MP
Logic Commands
Example:
BH = 0000 1111
NOT BH
=> BH = 11110000
14 PNEC
Instruction Set of 8088 MP
Shift Command
If CH = 00000001
SHL CH, 01
=> CH = 00000010
AL = 10000000
SHR AL,01
=> AL = 01000000
15 PNEC
Instruction Set of 8088 MP
Logic Commands
Examples:
Rotate Command
CH = 00000001
ROR CH, 01
=> CH = 10000000
AL = 10000000
ROL AL,01
=> AL = 00000001
16 PNEC
Instruction Set of 8088 MP
17 PNEC
Instruction Set of 8088 MP
18 PNEC
Instruction Set of 8088 MP
19 PNEC
Instruction Set of 8088 MP
Program Transfer Instructions:
Un Conditional JUMP Commands;
Example: JMP 0100h
In this command MP is asked to jump to the
mentioned memory location (eg address 0100h),
while doing this no conditioned is required to be
satisfied or tested. It is just an order for MP to ‘jump’
i.e to a particular memory location and fetch the next
instruction from it.
20 PNEC
Instruction Set of 8088 MP
Types of Unconditional jump commands;
i) Short Jump, ii) Near Jump and iii) Far Jump
Range of each type is +/- 128 Bytes, +/- 32KB, 64KB
respectively, from the location on which the jump command is
written
Short Jump is of 2 Bytes, one byte for the opcode and other for the
address,
Near jump is of 3 bytes, one for the opcode and two bytes for the
address,
Far jump is of 5 bytes, one for the opcode and four bytes for the
address
21 PNEC
Instruction Set of 8088 MP
Conditional JUMP Commands;
Examples: JS, JZ, JNZ, JP, JNP, JG, JL etc
In these commands MP is asked to jump to the
mentioned memory location (eg address 0100h),
while doing this specified condition/status is required
to be satisfied. It is just an order for MP to ‘jump’ to a
particular memory location and fetch the next
instruction from it, if and only if condition is satisfied,
otherwise not.
22 PNEC
Instruction Set of 8088 MP
Conditional JUMP Commands;
Conditional Jump commands test the Flag bits of the Status/Flag
Register, like ZF, SF, OF, PF, CF etc,
If the condition under test is fond to be true only then jump takes
place.
Range of Conditional Jumps is +127 bytes ahead and -128 bytes
back from the location on which the jump command is written
Example: SUB AL,BL
JZ Address
In the above example if due to the Subtraction Zero Flag gets
Set, now when JZ command tests the ZF and finds it Set then
MP “jumps” to the specified address/location and fetches the
23 next command from it PNEC
Instruction Set of 8088 MP
Conditional JUMP Commands;
Example 1: SUB AL,BL
JZ Address
In the above example if due to Subtraction, Zero Flag gets Set,
now when JZ command tests the ZF and finds it Set then MP
“jumps” to the specified address/location and fetches the next
command from it
Example 2: ADD AH,DH
JC Address
In the above example if due to Addition, Carry Flag gets Set, now
when JC command tests the CF and finds it Set then MP “jumps”
to the specified address/location and fetches the next command
24 from it PNEC
Instruction Set of 8088 MP
String Instructions:
By ‘String’ we mean series of data on consecutive
memory locations
String commands are power full command which
allow the programmer to perform operations on large
blocks of data, present on consecutive locations.
Operations may include movement of data, scanning
of data, comparison of data etc
25 PNEC
Instruction Set of 8088 MP
String Instructions:
In the following set of commands, a block of
data is moved from DS to ES
Examples:
CLD
MOV DI, 2500
MOV SI, 3500
MOV CX, 0100
REP MOVSB
26 PNEC
Instruction Set of 8088 MP (Contd)
Conditional JUMP Commands: More Examples;
JL = Jump if Less
JG = Jump if Greater
JA = Jump if Above
JB = Jump if Below
JE = Jump if Equal
JAE = Jump if Above or Equal
JLE = Jump if Less or Equal
27 PNEC
Program Example
Task:
Write a program to get data from an input device (address FF10h)
and multiply it with a number 0Fh.
If the product is not greater than the number stored on memory
location 2000h then send it to the output device(address AA20h),
other wise save it on memory location 3000h.
Keep program running.
This program is an example of IN/OUT & Memory Read/Write
operations.
28 PNEC
Program Example
Write comments for each command
29 PNEC