Indirect Addressing With Autoincrement; Indirect Addressing With The Stack Pointer; Indexed Addressing; Short-Indexed Addressing - Intel 8XC196K Series User Manual

Table of Contents

Advertisement

ADDB AL,BL,[CX]
POP
[AX]
3.2.3.1

Indirect Addressing with Autoincrement

You can choose to automatically increment the indirect address after the current access. You spec-
ify autoincrementing by adding a plus sign (+) to the end of the indirect reference. In this case,
the instruction automatically increments the indirect address (by one if the destination is an 8-bit
register or by two if it is a 16-bit register). When your code is assembled, the assembler automat-
ically sets the least-significant bit of the indirect address register. The following instructions use
indirect addressing with autoincrement:
LD
AX,[BX]+
ADDB AL,BL,[CX]+
PUSH [AX]+
3.2.3.2

Indirect Addressing with the Stack Pointer

You can also use indirect addressing to access the top of the stack by using the stack pointer as
the WORD register in an indirect reference. The following instruction uses indirect addressing
with the stack pointer:
PUSH [SP]
3.2.4

Indexed Addressing

Indexed addressing calculates an address by adding an offset to a base address. There are three
variations of indexed addressing: short-indexed, long-indexed, and zero-indexed. Both short- and
long-indexed addressing are used to access a specific element within a structure. Short-indexed
addressing can access up to 255 byte locations, long-indexed addressing can access up to 65,535
byte locations, and zero-indexed addressing can access a single location. An instruction can con-
tain only one indexed reference; any remaining operands must be register-direct references.
3.2.4.1

Short-indexed Addressing

In a short-indexed instruction, you specify the offset as an 8-bit constant and the base address as
an indirect address register (a WORD). The following instructions use short-indexed addressing.
LD
AX,12[BX]
MULB AX,BL,3[CX]
; AL ← BL + MEM_BYTE(CX)
; MEM_WORD(AX) ← MEM_WORD(SP)
; SP ← SP + 2
; AX ← MEM_WORD(BX)
; BX ← BX + 2
; AL ← BL + MEM_BYTE(CX)
; CX ← CX + 1
; SP ← SP - 2
; MEM_WORD(SP) ← MEM_WORD(AX)
; AX ← AX + 2
; duplicate top of stack
; SP ← SP +2
; AX ← MEM_WORD(BX+12)
; AX ← BL × MEM_BYTE(CX+3)
PROGRAMMING CONSIDERATIONS
3-7

Advertisement

Table of Contents
loading

Table of Contents