Program memory addressing mode
The addressing mode which
transfer the program control from one memory location to another memory
location is called program addressing mode. This addressing mode is used with
JMP and CAL instructions. These two instruction are used to transfer the
control of program execution to different memory location.(also this address
mode is used with memory locatios of code segment in which program are stored.)
these are 3 types of addressing mode.
1)
Direct program memory addressing
In addressing mode the address of
memory location where program execution control is to be transferred is stored in the instruction it self. For
example if a program jumps to memory location 10000H for the next instruction,
the address (1000H) is stored following the opcode in the memory. For example
the instruction JMP [10000H] is store in memory as follow.
JUMP instruction loads CS(code Segment) with 1000H and IP with 0000H to
jump to memory location. 10000H. for the next instruction.
2) Relative program memory addressing
The
term relative means “relative to the instruction pointer(IP)”. For example , if
a JMP instruction skips the next two bytes of memory, the address relative to
instruction pointer is a 2 that adds to the instruction pointer, this develops
the address of the next instruction. Relative JMP and CALL instruction contains
either 8 or 16 bit displacement that allows forward or reverse memory
reference.
For example the instruction JMP [2] is work as
follows;
MEMORY OPCODE MNEMONICS
ADDRESS
----------------------------------------------------------------
1000 H EB JMP [2]
1001 H 02
1002 H
1003 H
1004 H
-
3)
Indirect program addressing mode
In 8086 microprocessor there are
several forms of indirect program memory
addressing
for JMP and CALL instructions. In this mode
the address of memory location
where
jump is to be mode is stored in any 16 bit register i.e.
AX,BX,CX,DX,SP,BP,SI,DI
For example,
JMP [BX] ;
BX reg holds the address of JMP instruction.
0 Comments