90 likes | 471 Views
Addressing Modes. Six Memory Addressing Modes are supported Direct Addressing Memory address is directly specified mov [1234H],ax DS x 10H + DISP mov value, ax mov ax, buffer add bl, value cmp cx, count. Addressing Modes. Register Indirect Addressing
E N D
Addressing Modes • Six Memory Addressing Modes are supported • Direct Addressing • Memory address is directly specified • mov [1234H],ax DS x 10H + DISP • mov value, ax • mov ax, buffer • add bl, value • cmp cx, count Lecture 17
Addressing Modes • Register Indirect Addressing • The effective address of memory is the contents of a register • mov [bx],cl DS x 10H + BX • [si], [di], [bx] with respect to DS • [bp] with respect to SS • mov ax, [si] • add bl, [di] • cmp cx, [bx] Lecture 17
Addressing Modes • Based or Register Relative Addressing • The effective memory address is the sum of a base register and a displacement • List[bx], [bp+1] • mov cl, [bx+4] DS x 10H + BX + 4 • mov ax, list[bx] • add bl, [bx+7] • cmp cx, [bp-3] Lecture 17
Addressing Modes • Indexed Addressing • The effective memory address is the sum of an index register and a displacement • mov [bx+2], bp DS x 10H + BX + 2 • List[si], [list + di], [di+2] • mov ax, list[si] • add bl, [number+di] • cmp cx, [di+2] Lecture 17
Addressing Modes • Base Indexed or Base-Plus-Index Addressing • The effective memory address is the sum of a base register and an index register • [bx+si], [bx][di], [bp+di] • mov [bx+si], bp DS x 10H + BX + SI will use DS as default seg • mov ax, [bx+si] • add bl, [bx][si] • cmp cx, [bp+di] Lecture 17
Addressing Modes • Base Indexed with Displacement or Base Relative-Plus-Index Addressing • The effective memory address is the sum of base register, index register and a displacement • [bx+si+2], list[bx+di] • mov array[bx + si], dx DS x 10H + ARRAY + BX + SI • mov ax, array[bx+si] • add bl, [bx+di+2] • cmp cx, 2[bp+di] Lecture 17
Addressing Modes • Summary | bx | si | disp | | | | bp | di | Lecture 17