Describe the addressing modes of 8086 microprocessor .
The 8086 BIU we described how the 8086 accesses code bytes suing CS and IP. We also described how the 8086 accesses the stack using SS and SP. The different ways that an 8086 can access the data that it operates on. The different ways that a processor can access data are referred to as its addressing modes. In assembly language statement the addressing mode is indicated in the instruction. We will used the 8086 MOV instruction to illustrate some of the 8086 addressing modes.
The Move instruction has the format:-
MOV destination, source
When executed, this instruction copies a word or a byte from the specified source location to the specified destination location. The source can be a number written directly in a instruction, s specified register, or a memory location specified in one of 24 different ways. The destination can be a specified register or a memory location specified in any one of 24 different ways. the source and the destination cannot both be memory locations in an instruction.
Immediate Addressing Mode
Suppose that in a program you need to put the number 437H in te CS register. The MOV CX , 437BH instruction can be used to do this when it executes, this instruction will put the immediate hexadecimal number 437BH in the 16-it CX register. This is referred to as immediate addressing mode because the number to be loaded into the CS register will be put in two memory locations immediately following the code for the MOV instruction. This is similar to the way the port address was put in memory immediately after the code for the input instruction in the three-instruction program in above figure.
Register Addressing Mode
Register addressing mode means that a register is the source of an operand for an
Instruction. The instruction
MOV CS,AX ( example)
Copies the contents of the 16 –bits AX register into the 16 bit CX register. Remember that the Destination location is specified in the instruction before te source. Also not hat the contents of AX are just copied t CX. Not actually moved. In other words, the previous content of CS are written over, but the contents of AX are not changed.
Direct Addressing Mode
For the simplest memory addressing mode the effective address is just an 8 and 16 bit number written directly in the instruction. The instruction MOV CL,[437 AH] is an example . the square brackets around the 437AH are shorthand for “ te contents of the memory location at a displacement from the segment base of “ when executed. This instruction will copy the contents of the memory location, at a displacement of 437 AH from the data segment base, into the CL register. Shifting the data segment base in DS four bits left and adding the effective address 437AH to the result will produce the actual 20-bit pysical memory address. Above figure sows how the operation is done. This addressing mode is called direct because the displacement of operand from the segment base is specified directly in the instruction. The displacement in the instruction will be added to the data segment base in DS unless you used a segment override prefix to tell the BIU to add it to some other segment base.