









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!










;initialize counter
NOTE:
List of basic instructions Table 3.1 in Rafiquzzaman’s Book.
Detailed
explanations
in
Marut’s
book
Name
operation
operand(s)
comment
Detailed
explanations
in
Marut’s
book
Also see the 8086 Assembly Language Publication handout uploaded to drive.
Farhana B Sufi (PhD), 2024
Farhana B Sufi (PhD), 2024
Ref. Book: Rafiquzzaman
Farhana B Sufi (PhD), 2024
Rafiquzzaman
The BIU computes the 20-bit Physical address internally – example
Code Segment Register (CS) = 456A
H
hift CS to the left by 4bits = 456A
H
Instruction
Pointer
(
IP)
=
1620
H
1620
H
Instruction
Pointer
(
IP)
=
1620
H
1620
H
20-bit Physical address is
= 46CC
H
PUSH & POP)
Farhana B Sufi (PhD), 2024
Rafiquzzaman
EU has the general data registersAX - accumulatorBX – base registerCX – count
“
DX – data
“
And theSP Stack PointerBP Base “SI Source Index DI Destination “
Farhana B Sufi (PhD), 2024
Ref. Book: Rafiquzzaman
DI Destination “ FLAGS BIU has four 16-bit segment registers:Code Segment Register CSData
“
“
DS
Stack
“
“
SS
Extra
“
“
ES
AndInstruction Pointer
IP
1.
If [DS] -
16
16
and [BX] = 2456
16
then after MOV [DI], BX, content of BX (
16
) is moved to memory
locations 50060
16
and 50061
16
Farhana B Sufi (PhD), 2024
Rafiquzzaman
EA is obtained by adding a displacement (signed 8 bit or unsigned 16bit) value tothe contents of BX or BP. The segment registers used arc DS and SS. Whenmemory is accessed using BX, the 20bit physical address is computed from BX andDS. On the other hand, when the stack is accessed, the 20 bit physical address iscomputed from BP and SS.
Farhana B Sufi (PhD), 2024
Rafiquzzaman
Based AddressingMode:
Fig 3.4: Rafiquzzaman
e.g. MOV BH, ARRAY [SI], moves the contents of the 20-bit address computed fro thedisplacement ARRAY, SI and DS into BH. Note
for
both
based
and
indexed
modes,
the
obtains
the
by
using
the
Note
for
both
based
and
indexed
modes,
the
obtains
the
by
using
the
equation EA = RA + M, where RA is the Reference Address and M is the Modifier, Incase of based addressing mode, RA is held in a register such as BX or BP.The based mode is useful in accessing segmented memory in which BX or BP holds thebase address of a segment. In indexed
addressing mode, on the other hand, RA is
included as part of the instruction and the 8086 register SI or DI contains the value ofM. RA can be unsigned 16 bit or signed-extended 8bit.
Farhana B Sufi (PhD), 2024
Rafiquzzaman
For accessing I/O ports (I/O modes):
and
For memory-mapped I/O
In direct port mode the port number is an 8bit address (0 to 255) e.g. OUT 05H, AL -^
In indirect port mode port number is taken from DX. e.g. IN AL, DX
where [DX] = 5040
16
Relative addressing mode:
The EA is calculated with reference to the IP.e.g : JNZ 8 bit address IP = IP + 8 bit address. 3.
Implied addressing mode:
Instructions will have no operands.e.g. CLC
Farhana B Sufi (PhD), 2024