Presentation is loading. Please wait.

Presentation is loading. Please wait.

1/2002JNM1 AL 00 Immediate Addressing Mode Mov AL, 3CH AL 3C.

Similar presentations


Presentation on theme: "1/2002JNM1 AL 00 Immediate Addressing Mode Mov AL, 3CH AL 3C."— Presentation transcript:

1 1/2002JNM1 AL 00 Immediate Addressing Mode Mov AL, 3CH AL 3C

2 1/2002JNM2 Register Addressing Mode Mov AL, BL AL 00 BL4D AL4D BL4D

3 1/2002JNM3 Direct Addressing Mode Mov CL, [0020H] Mov CX, [0020H] Memory (data) Little Endian Format – The “little” end of the number is stored first. CL 78 CX 5678 Mov ECX, [0020H] ECX 12345678

4 1/2002JNM4 Register Indirect Addressing Mode Mov CL, [SI] In the 8086, only BX, BP, SI and DI may be used as memory pointers. Later processors don’t have this restriction. Mov SI, 0022H CL 34 SI 0022

5 1/2002JNM5 BX 0020 Base + Displacement Mov AL, [BX +2] 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. Mov BX, 0020H AL 34

6 1/2002JNM6 BX 0020 Base + Index + Displacement (Useful when accessing individual elements in an record) Mov BX, 0020H ;BX points to record starting address SI 000C Mov SI, 000CH ;SI points to record three (4 elements ;per record x 3 records = 000C) Mov AL, [BX+SI+1] ;AL now has the data in element 1 of ;record #3 (assumes elements are 1 byte)

7 1/2002JNM7 Base + Displacement –Mov AL, [BX + 4] Base + Index + Displacement –Mov AL, [BX+SI+3] Base + Index*Scale + Displacement –Mov AL,[BX+SI*4+3] Immediate –Mov AL, 4CH Register –Mov AL, BL Direct –Mov AL, [20H] Register Indirect –Mov AL, [SI] Instruction Addressing Modes

8 1/2002JNM8 Direct Addressing Direct-Offset Addressing Offset operator – returns the 16-bit address of the variable. Good for strings and arrays..data Bytelist db 35h, 63h, 79h Wordlist dw 1234h, 5678h.code … Moval, Bytelist; al = 35 Moval, Bytelist+1; al = 63 Movbx, Wordlist; bx = 1234 Movbx, Wordlist+2; bx = 5678

9 1/2002JNM9 Direct-Offset Addressing with Strings.data aString db “ASTRING”.code … Moval, aString; al = 41 Moval, aString+1; al = 53 Moval, aString+2; al = 54 Moval, aString+3; al = 52


Download ppt "1/2002JNM1 AL 00 Immediate Addressing Mode Mov AL, 3CH AL 3C."

Similar presentations


Ads by Google