(ASM) Lab 3
(ASM) Lab 3
Assembly Language
Lab (3)
Agenda
To run a program
written in a high level
language we should
have a converter
called …..?
Computer Organization
CPU
Main Control
ALU
Memory unit
R1 R2 R3 R4
Special Purpose
(Segment) Register
Main Memory
Byte
Main
Memory
Memory Modes:
Real Mode (8086) – 16 Bit Registers
CPU 8086
20
Main Memory 1 MByte (2 𝑏𝑦𝑡𝑒)
Program Segment 64 k
Memory Modes:
Real Mode (8086) – 16 Bit Registers
SP
Stack
BP
Pointers and Index Registers
The pointers will always store some address or memory
location. In 8086 Microprocessor, they usually store the
offset through which the actual address is calculated.
1. Instruction Pointer (IP):
The instruction pointer usually stores the address of the next
instruction that is to be executed. Apart from this, it also acts as
an offset for CS register.
2. Base Pointer (BP):
The Base pointer stores the base address of the memory. Also,
it acts as an offset for Stack Segment (SS).
► Stack Pointer (SP):
The Stack Pointer Points at the current top value of the Stack. Like the
BP, it also acts as an offset to the Stack Segment (SS).
The indexes are used with the extra segment and they usually are used
for copying the contents of a particular block of memory to a new
location.
1. Source Index (SI):
It stores the offset address of the source.
2. Destination Index (DI):
It stores the offset address of the Destination.
Memory Modes:
Real Mode (8086) – 16 Bit Registers
Examples:
1. Segment Register: 047C
Offset Register: 0048
Physical address: 047C0 + 0048 = 04808 Same
address!