8086 Microprocessor

Click here to load reader

download 8086 Microprocessor

of 20

description

addressing modes of 8086

Transcript of 8086 Microprocessor

8086 microprocessor

8086 microprocessorMachine language instructionsGeneral instruction format:

Opcode operand operand

LABEL: INSTRUCTION ; COMMENTAddress identifier Does not generate any machine code

Ex. START: MOV AX, BX ; copy BX into AX

Addressing modes:The way in which an operand is specified is called its addressing mode.

These are divided into two categories:Data related addressing modesBranch related addressing modes.Data related addressing modesImmediate:

8or 16-bit data can be specified as part of the instructionE.g. MOV AL, 45HMOV BX, 5062H

Data related addressing modesRegister addressing mode:

Source/destination can be one of the 8086 registersMOV AX, BX ; 16-bit data transferMOV AL, BL ; 8-bit data transfer

Data related addressing modesDirect addressing mode:

Effective address is specified directly in the instructionE.g. MOV BX, [5062]20-bit physical address of memory location is calculated using DS and offset value 5062

Data related addressing modesRegister indirect addressing mode:

The effective address of memory operand is present in one of the base or index registers [BX, BP, SI, DI]E.g. MOV CX, [BX]If DS = 2000H, BX = 0004H THEN contents of memory location 20004H are copied to register CX

Data related addressing modesRegister relative addressing mode:

Data related addressing modesEffective address is sum of16-bit offset given in instructionContents of base register BX or BPSegment register is DS or SS E.g. MOV AX, 4[BX]E.G. PUSH CX

Data related addressing modesBased indexed addressing mode

Data related addressing modesEffective address is sum of16-bit offset given in instructionContents of index register SI or DIContents of base register BX or BPSegment register is DS E.g. MOV AX, [BX][SI]

Data related addressing modesRelative based indexed mode:

Data related addressing modesEffective address is sum of16-bit offset given in instructionContents of index register SI or DIContents of base register BX or BPSegment register is DS E.g. MOV AX, 4 [BX][SI]

Branch Related addressing modes

Branch Related addressing modesIntrasegment(CS does not change)Direct -- IP relative displacement new IP = old IP + displacement Allows program relocation with no change in code.Intersegment Direct -- new CS and IP are encoded in(CS changes) the instruction.Indirect -- new CS and IP are in memory. All addressing modes apply except immediate and register.NEAR JUMPS and CALLSFARIndirect -- new IP is in memory or a register. All addressing modes apply.