ZHCUCH3A November 2024 – March 2025 F29H850TU , F29H859TU-Q1
这是一个用于地址间接编码的 5 位字段,可在所有“指针寻址”模式下使用。
表 4-3 展示了使用 5 位对地址进行编码的各种方式。
| ADDR2 字段:(Az = A4 到 A7) | |||||||
|---|---|---|---|---|---|---|---|
| 助记符 | 简写 | 地址生成 | 4 | 3 | 2 | 1 | 0 |
| *(Az++A0) | *Az++A0 | addr = Az,Az = Az + A0 | 0 | 0 | 0 | Az[4-7] | |
| *(Az++A1) | *Az++A1 | addr = Az,Az = Az + A1 | 0 | 0 | 1 | Az[4-7] | |
| *(Az+A0<<#scale) | *Az[A0] | addr = Az + A0 << (0/1/2/3) (1) | 0 | 1 | 0 | Az[4-7] | |
| *(Az+A1<<#scale) | *Az[A1] | addr = Az + A1 << (0/1/2/3) (1) | 0 | 1 | 1 | Az[4-7] | |
| *Az | *Az | addr = Az | 1 | 0 | 0 | Az[4-7] | |
| *(Az++#size) | *Az++ | addr = Az,Az = Az + (1/2/4/8) (#size = 1,2,4,8) (1) | 1 | 0 | 1 | Az[4-7] | |
| *(Az--#size) | *Az-- | addr = Az,Az = Az – (1/2/4/8) (#size = 1,2,4,8) (1) | 1 | 1 | 0 | Az[4-7] | |
| *(Az-=#size) | *--Az | Az = Az – (1/2/4/8),addr = Az (#size = 1,2,4,8) (1) | 1 | 1 | 1 | Az[4-7] | |
以下是可以使用 ADDR2 字段的指令:
AND.32、ANDOR、LD.32、LD.64、MV.16、MV.32、MV.64、MV.8、OR.32、ST.16、ST.32、ST.64、ST.8、XOR.32
示例:
; Register XMx is loaded with the 64-bit word at the memory location
; addressed using the ADDR2 addressing mode. This address is fetched from Az.
LD.64 XMx,ADDR2 ; field
LD.64 XMx,*Az ; addressing mode
LD.64 XM4,*A4 ; actual assembly code
; The 8-bit immediate value specified is stored at the memory location
; addressed using the ADDR2 addressing mode. The address is fetched from Az,
; which is then post-decremented by the amount in #size. The #size is
; automatically chosen by the CPU to be 1 since the word size accessed by
; this instruction is 8-bit.
ST.8 ADDR2,#0x0B ; field
ST.8 *(Az--#size),#0x0B ; addressing mode
ST.8 *(Az--#1),#0x0B ; actual assembly