Addressing Modes of 8086 Processor Ammar Anwar Khan Electrical Engineer King Saud University Riyadh...

15
Addressing Modes of 8086 Processor Ammar Anwar Khan Electrical Engineer King Saud University Riyadh Saudi Arabia

Transcript of Addressing Modes of 8086 Processor Ammar Anwar Khan Electrical Engineer King Saud University Riyadh...

Page 1: Addressing Modes of 8086 Processor Ammar Anwar Khan Electrical Engineer King Saud University Riyadh Saudi Arabia.

Addressing Modes of 8086 Processor

Ammar Anwar KhanElectrical Engineer

King Saud UniversityRiyadh

Saudi Arabia

Page 2: Addressing Modes of 8086 Processor Ammar Anwar Khan Electrical Engineer King Saud University Riyadh 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.

Page 3: Addressing Modes of 8086 Processor Ammar Anwar Khan Electrical Engineer King Saud University Riyadh Saudi Arabia.

Immediate Addressing Mode

MOV AL,10h MOV AX,0AC8h

MOV AH,4ch MOV DX,1000h

Page 4: Addressing Modes of 8086 Processor Ammar Anwar Khan Electrical Engineer King Saud University Riyadh Saudi Arabia.

Register Addressing Mode

MOV AL,BL MOV AX,BX

Page 5: Addressing Modes of 8086 Processor Ammar Anwar Khan Electrical Engineer King Saud University Riyadh Saudi Arabia.

Direct addressing Mode

MOV DX,[1000H]

Page 6: Addressing Modes of 8086 Processor Ammar Anwar Khan Electrical Engineer King Saud University Riyadh Saudi Arabia.

Register Indirect Addressing Mode

MOV AL,[BX] MOV AX,[BX]

Page 7: Addressing Modes of 8086 Processor Ammar Anwar Khan Electrical Engineer King Saud University Riyadh Saudi Arabia.

PUSH & POP

MOV AX, 30 PUSH AX POP BX

SS=FFEE SS=FFEC SS=FFEE

Page 8: Addressing Modes of 8086 Processor Ammar Anwar Khan Electrical Engineer King Saud University Riyadh Saudi Arabia.
Page 9: Addressing Modes of 8086 Processor Ammar Anwar Khan Electrical Engineer King Saud University Riyadh Saudi Arabia.

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

Page 10: Addressing Modes of 8086 Processor Ammar Anwar Khan Electrical Engineer King Saud University Riyadh Saudi Arabia.

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

Page 11: Addressing Modes of 8086 Processor Ammar Anwar Khan Electrical Engineer King Saud University Riyadh Saudi Arabia.

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

Page 12: Addressing Modes of 8086 Processor Ammar Anwar Khan Electrical Engineer King Saud University Riyadh Saudi Arabia.

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

Page 13: Addressing Modes of 8086 Processor Ammar Anwar Khan Electrical Engineer King Saud University Riyadh Saudi Arabia.

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

Page 14: Addressing Modes of 8086 Processor Ammar Anwar Khan Electrical Engineer King Saud University Riyadh Saudi Arabia.

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.

Page 15: Addressing Modes of 8086 Processor Ammar Anwar Khan Electrical Engineer King Saud University Riyadh Saudi Arabia.

Thanks

END