Instruction Set Of 8086 Microprocessor
The
instruction set of 8086 microprocessor contains different instruction to
perform operations such as data transfer, arithmetic, logic, shift, rotate,
& control.
An
instruction for microprocessor is the way to specify operations that we perform
upon data. Data is stored in operands. For 8086 microprocessor an operands can
be 16-bit internal register, a memory location or immediate number. Most of
8086 instructions have two operands (source and destination) but many
instructions have only one operand. The instructions of 8086 classified into
following groups.
1] Data Movement
Instruction
2] Arithmetic
3] Logical
4] Shift &
Rotate
5] Branching
& Jump
6] Machine
control or Miscellaneous instruction.
I] Data Movement Instruction
The
instructions in this group are used to copy data from source operand to
destination operand.
1] MOV
This
instruction is used to copy data stored in source into destination. The source
can be 8/16 bit register, memory location or immediate data (number) .
Destination can be 8/16 bit register, memory location.
Example, MOV
AL,04H
MOV
AL,BL
MOV
AH,[2000]
MOV
[4000],AX
MOV
[5000],35H
2] XCHG
Syntax –
This instruction is used to exchanges the contents of source with the contents of destination. The source can be 8/16 bit register or memory location. Destination can be 8/16 bit register, memory location. The XCHG cannot directly exchange the contents of two memory location
1) Program Title:- WALP (Write Assembly Language Program) to copy 8
bit number i.e. 22H & 55 H in AL & BL register respectively.
Register Used: - AL & BL
Data: - 22 H & 55 H
Address |
Op-code |
Label |
Mnemonic |
Operand |
Comments |
|
|
|
MOV |
AL,22H |
COPY 22H IN AL |
|
|
|
MOV |
BL,55H |
COPY 55H IN BL |
|
|
|
INT |
03 |
STOP |
Result:-
AL =
22H
BL =
55H
2) Program Title: - WALP (Write Assembly Language Program) to store 55
H, 88 H, 99 H, 44 H, 02 H, 03 H, 04 H
& 05H IN AL, BL, CL, DL, AH, BH, CH & DH Register respectively.
Register Used: -AL, BL, CL, DL, AH, BH, CH & DH
Data: -55 H, 88 H, 99 H, 44 H, 02 H, 03
H, 04 H & 05H
Address |
Op-code |
Label |
Mnemonic |
Operand |
Comments |
|
|
|
MOV |
AL,55H |
COPY 55H IN AL |
|
|
|
MOV |
BL,88H |
COPY 88H IN BL |
|
|
|
MOV |
CL,99H |
COPY 99H IN CL |
|
|
|
MOV |
DL, 44H |
COPY 44H IN DL |
|
|
|
MOV |
AH,02H |
COPY 02H IN AH |
|
|
|
MOV |
BH,03H |
COPY 03H IN BH |
|
|
|
MOV |
CH,04H |
COPY 04H IN CH |
|
|
|
MOV |
DH,05H |
COPY 05H IN DH |
|
|
|
INT |
03 |
STOP |
Result:-
AX =
0255H
BX =
0388H
CX =
0499H
DX =
0544H
3) Program Title: - WALP to store 55 H, 88 H, in AL, BL Register
respectively. Copy the contents of AL register on memory location [2000] and
contents of BL register on memory location [3000]. (DS = 0200H)
Register & Memory address Used: -AL, BL, DS, [2000] & [3000]
Data: -55 H, 88 H, [2000] & [3000]
Address |
Op-code |
Label |
Mnemonic |
Operand |
Comments |
|
|
|
MOV |
AX,0200H |
Initialisation of DS |
|
|
|
MOV |
DS,AX |
|
|
|
|
MOV |
AL,55H |
Copy 55h In AL |
|
|
|
MOV |
BL,88H |
Copy 88h In BL |
|
|
|
MOV |
[2000],AL |
Copy Contents Of Al On Memory
Location [2000] |
|
|
|
MOV |
[3000],BL |
Copy Contents Of Al On Memory Location
[3000] |
|
|
|
INT |
03 |
STOP |
Result:-
DS : OFFEST
: DATA
0200:[2000]:55H
0200:[3000]
:88H
4) Program Title: - WALP to store 55 H, 88 H, in AL, BL Register
respectively. Exchange contents of AL&BL using third register.
Register Used: -AL, BL &CL
Data: - 55 H& 88 H
Address |
Op-code |
Label |
Mnemonic |
Operand |
Comments |
|
|
|
MOV |
AL,22H |
COPY 22H IN AL |
|
|
|
MOV |
BL,55H |
COPY 55H IN BL |
|
|
|
MOV |
CL,AL |
COPY THE CONTENTS OF AL TO CL |
|
|
|
MOV |
AL,BL |
COPY THE CONTENTS OF BL TO AL |
|
|
|
MOV |
BL,CL |
COPY THE CONTENTS OF CL TO BL |
|
|
|
INT |
03 |
STOP |
AL = 55H
BL = 22H
5) Program Title: - WALP to store 55 H, 88 H, in AL, BL Register
respectively. Copy the contents of AL register on memory location [2000] and
contents of BL register on memory location [3000] then exchange contents of
memory location [2000] & [3000] using register. (DS = 0200H)
Data: - 55 H, 88 H, [2000] & [3000]
Address |
Op-code |
Label |
Mnemonic |
Operand |
Comments |
|
|
|
MOV |
AX,0200H |
Initialisation of DS |
|
|
|
MOV |
DS,AX |
|
|
|
|
MOV |
AL,55H |
Copy 55H In AL |
|
|
|
MOV |
BL,88H |
Copy 88H In BL |
|
|
|
MOV |
[2000],AL |
Copy Contents Of AL On Memory
Location [2000] |
|
|
|
MOV |
[3000],BL |
Copy Contents Of AL On Memory
Location [3000] |
|
|
|
MOV |
CL,[2000] |
Copy Contents Of Memory
Location [2000] to CL |
|
|
|
MOV |
DL,[3000] |
Copy Contents Of Memory
Location [3000] to DL |
|
|
|
MOV |
[2000],DL |
Copy Contents Of DL On Memory
Location [2000] |
|
|
|
MOV |
[3000],CL |
Copy Contents Of CL On Memory
Location [3000] |
|
|
|
INT |
03 |
Stop |
Result:-
DS : OFFEST
: DATA
0200:[2000]:88H
0200:[3000]
:55H
6) Program Title: - WALP to store 44H & 55H in AL & BL register
respectively. Exchange the contents of register using XCHG instruction.
Register Used: - AL & BL
Data: - 44H & 55H
Address |
Op-code |
Label |
Mnemonic |
Operand |
Comments |
|
|
|
MOV |
AL,44H |
COPY 44H IN AL |
|
|
|
MOV |
BL,55H |
COPY 55H IN BL |
|
|
|
XCHG |
AL,BL |
Exchange contents of AL
register With BL register |
|
|
|
INT |
03 |
STOP |
Result:-
AL =
55H
BL = 44H
3) PUSH
Syntax
– PUSH Source
This
instruction is used to copy data stored in source onto memory location pointed
by stack pointer register(SP). The source can be 16 bit register. Therefore
after execution of PUSH instruction SP is decremented by 2. This instruction
copies data into stack memory area pointed by stack pointer.
Example, PUSH AX
PUSH
IP
PUSH FLAG
4) POP
Syntax
– POP Destination
This
instruction is used to copy data from memory location pointed by stack pointer
register (SP) into destination. The destination can be 16 bit register.
Therefore after execution of POP instruction SP is incremented by 2. This
instruction copies data from stack memory area pointed by stack pointer.
Example, POP AX
POP
CS
POP
FLAG
Operation code : The operation code field in the instruction
specifies the operation to be performed.
1 Comments
Thanks sir
ReplyDelete