Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
101
Добавлен:
01.03.2016
Размер:
921.07 Кб
Скачать

PM0044

STM8 addressing modes

 

 

6.11Long Pointer Indirect Extended Indexed addressing mode

The pointer address is a word, the pointer size is an extended word, thus allowing 16-Mbyte addressing space, and requires 2 bytes after the op-code.

Example:

 

 

 

1089

180000

ptr

dc.b

page(table), high(table), low(table)

180000

10203040 table

dc.b

$10,$20,$30,$40

1690

AE03

 

LD

X,#3

1692

72A71089

 

LDF

A,([longptr.e],X)

 

 

 

X = 3

 

A = ([longptr.e],X) = ((longptr.e), X) = (($1089.e), 3)

= ($180000,3) = ($180003) = $40

Doc ID 13590 Rev 3

53/162

STM8 addressing modes

PM0044

 

 

Figure 20. Long Pointer Indirect Extended Indexed addressing mode example

 

 

 

 

 

 

Before completion

 

18

1089

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

ptr .word table

00

108A

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

00

108B

 

 

 

 

 

 

PC

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

LDF A,([longptr.w],X)

72

1692

 

 

 

 

 

 

 

1692

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

A7

1693

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

10

1694

 

 

 

 

 

 

 

X

 

 

 

 

 

 

 

 

 

 

 

 

89

1695

 

 

 

 

 

03

 

 

 

 

 

 

 

 

 

 

A

 

 

 

 

 

 

 

 

 

 

Previous value

table .byte 0x10,0x20,0x30,

10

180000

 

 

 

 

 

0x40

20

180001

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

30

180002

 

180000

 

 

 

 

 

 

 

 

Adder

 

40

180003

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Steps to Determine

Effective Address

PC = 1692

PC = PC + 2 = 1694

EA= (((PC) : (PC+1)) : ((PC) : (PC+1) +1) : ((PC) : (PC+1) +2)) + X

EA = 180003

03

EA

180003

 

 

 

 

 

After completion

 

 

 

 

 

 

 

 

 

 

 

 

18

1089

 

 

 

 

 

 

 

 

108A

 

 

 

 

 

 

ptr .word table

00

 

 

 

 

 

Instruction Complete

 

00

108B

 

 

 

 

 

 

 

 

 

 

 

 

X

 

A = (EA) = 40

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

New PC = PC + 2 = 1696

LDF A,([longptr.w],X)

72

1692

 

03

 

 

 

 

 

 

 

 

 

 

 

 

 

 

A7

1693

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

10

1694

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

89

1695

 

 

 

New PC

 

 

 

 

1696

 

 

 

 

 

 

 

 

1696

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

table .byte 0x10,0x20,0x30,

10

180000

 

 

 

 

 

 

0x40

 

 

 

 

 

 

 

 

20

180001

 

 

 

 

 

 

 

 

 

 

 

 

 

 

30

180002

 

 

 

A

 

VR02059I

 

 

 

 

 

 

 

 

 

40

 

 

 

 

 

 

 

180003

 

 

 

40

 

 

 

 

 

 

 

 

54/162

Doc ID 13590 Rev 3

Соседние файлы в папке Минимум документации STM8