Title: Immediate Addressing Mode
1Immediate Addressing Mode
AL 00
Mov AL, 3CH
AL 3C
2Register Addressing Mode
AL 00 BL 4D
Mov AL, BL
AL 4D BL 4D
3Direct Addressing Mode
Mov CL, 0020H
Memory (data)
CL 78
Mov CX, 0020H
CX 5678
Mov ECX, 0020H
ECX 12345678
Little Endian Format The little end of the
number is stored first.
4Register Indirect Addressing Mode
Mov SI, 0022H
SI 0022
Mov CL, SI
CL 34
In the 8086, only BX, BP, SI and DI may be used
as memory pointers. Later processors dont have
this restriction.
5Base Displacement
Mov BX, 0020H
BX 0020
Mov AL, BX 2
AL 34
Useful when accessing individual elements in an
array. Note that the array begins with element 0,
element 2 corresponds to the third location in
the array. The displacement corresponds to byte
offset from the base, not element number in the
array.
6Base Index Displacement
(Useful when accessing individual elements in an
record)
Mov BX, 0020H BX points to record starting
address
BX 0020
Mov SI, 000CH SI points to record three
(4 elements per record x 3
records 000C)
SI 000C
Mov AL, BXSI1 AL now has the data in
element 1 of record 3 (assumes
elements are 1 byte)
7Instruction Addressing Modes
- Base Displacement
- Mov AL, BX 4
- Base Index Displacement
- Mov AL, BXSI3
- Base IndexScale Displacement
- Mov AL,BXSI43
- Immediate
- Mov AL, 4CH
- Register
- Mov AL, BL
- Direct
- Mov AL, 20H
- Register Indirect
- Mov AL, SI
8Direct Addressing Direct-Offset Addressing
.data Bytelist db 35h, 63h , 79h Wordlist
dw 1234h, 5678h .code Mov al, Bytelist
al 35 Mov al, Bytelist1 al 63 Mov bx,
Wordlist bx 1234 Mov bx, Wordlist2 bx
5678
Offset operator returns the 16-bit address of
the variable. Good for strings and arrays.
9Direct-Offset Addressing with Strings
.data aString db ASTRING .code Mov al,
aString al 41 Mov al, aString1 al
53 Mov al, aString2 al 54 Mov al,
aString3 al 52