Post on 20-Jan-2016
Addressing Modes of 8086 Processor
Ammar Anwar KhanElectrical Engineer
King Saud UniversityRiyadh
Saudi Arabia
Addressing Modes
Addressing Modes which are common to 8086 processor.
Immediate Addressing Mode. Register Addressing Mode. Direct addressing Mode. Register Indirect Addressing Mode.
Immediate Addressing Mode
MOV AL,10h MOV AX,0AC8h
MOV AH,4ch MOV DX,1000h
Register Addressing Mode
MOV AL,BL MOV AX,BX
Direct addressing Mode
MOV DX,[1000H]
Register Indirect Addressing Mode
MOV AL,[BX] MOV AX,[BX]
PUSH & POP
MOV AX, 30 PUSH AX POP BX
SS=FFEE SS=FFEC SS=FFEE
The XCHG InstructionThe XCHG InstructionExchangeExchange
The XCHG (exchange) instruction swaps two values. The general form is:
XCHG operand1, operand2
There are four specific forms of this instruction on the 80x86:
XCHG reg, mem
XCHG reg, reg
The LEA InstructionThe LEA InstructionLoad effective addressLoad effective address
The LEA (Load Effective Address) loads the specified 16 bit general purpose register with the effective address of the specified memory location. LEA takes the form:
LEA destinaton, source
LEA DX,[BX][SI]+100H
DX=effective address=2000+3500+100=5600H
The STOSx InstructionThe STOSx InstructionStore byte or word stringStore byte or word string
The STOSx (where x: B or W), copies a byte or word from AX, AL to a location pointed by ES:DI and updates DI to point to the next string element. If DF is 0, DI increment otherwise decrements
The LDS InstructionThe LDS InstructionLoad Data Segment registerLoad Data Segment register
Load into destination the contents of two memory locations and segment register the next two memory locations:
LDS destinaton, source
DS:1200=46
DS:1201:10
DS:1202:38
DS:1202:82
LDS DI,[1200] ; DI=1046 and DS=8238
The MOVSx InstructionThe MOVSx InstructionMove Byte or word StringMove Byte or word String
Moves byte or word from memory location pointed to by DS:SI to the memory location pointed to by ES:DI. SI and DI increment if DF is 0 otherwise decrement:
LEA destinaton, source
LEA DX,[BX][SI]+100H
DX=effective address=2000+3500+100=5600H
The XLAT InstructionThe XLAT InstructionTranslateTranslate
Replace the contents of AL with the contents of Lookup table pointed by AL, BX contains the starting location of Lookup table.
Thanks
END