Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
8xC196EA microcontroller user's manual.1998.pdf
Скачиваний:
52
Добавлен:
23.08.2013
Размер:
8.29 Mб
Скачать

8XC196EA USER’S MANUAL

3.2.3Indirect Addressing

The indirect addressing mode accesses an operand by obtaining its address from a WORD register in the lower register file. You specify the register containing the indirect address by enclosing it in square brackets ([ ]). The indirect address can refer to any location within the address space, including the register file. The register that contains the indirect address must be word-aligned, and the indirect address must conform to the rules for the operand type. An instruction can contain only one indirect reference; any remaining operands must be direct references. The following instructions use indirect addressing:

LD

AX,[BX]

; AX

MEM_WORD(BX)

ADDB

AL,BL,[CX]

;

AL

BL + MEM_BYTE(CX)

POP

[AX]

;

MEM_WORD(AX) MEM_WORD(SP)

;SP SP + 2

3.2.3.1Extended Indirect Addressing

Extended load and store instructions can use indirect addressing. The only difference is that the register containing the indirect address must be a word-aligned 24-bit register to allow access to the entire address space. The following instructions use extended indirect addressing:

ELD

AX,[EX]

; AX

MEM_WORD(EX)

ELDB

AL,[EX]

; AL

MEM_BYTE(EX)

EST

AX,[EX]

;

MEM_WORD(EX)

AX

ESTB AL,[EX]

;

MEM_BYTE(EX)

AL

3.2.3.2Indirect Addressing with Autoincrement

You can choose to automatically increment the indirect address after the current access. You specify 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 automatically sets the least-significant bit of the indirect address register. The following instructions use indirect addressing with autoincrement:

LD

AX,[BX]+

; AX MEM_WORD(BX)

 

 

; BX BX + 2

ADDB

AL,BL,[CX]+

; AL BL + MEM_BYTE(CX)

 

 

;

CX

CX

+

1

PUSH

[AX]+

;

SP

SP

-

2

;MEM_WORD(SP) MEM_WORD(AX)

;AX AX + 2

3-8

Соседние файлы в предмете Электротехника