SPRUIY2A November 2024 – March 2025 F29H850TU , F29H859TU-Q1
This is a 16-bit field for indirect encoding of addresses that can be used in all "Pointer Addressing" and "Stack Addressing" modes.
Table 4-2 shows the various ways the 16 bits can be used to encode the address.
| ADDR1 Field: (Ax = A0 to A14, Aj = A0 to A14, Ak = A0 to A3) | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Mnemonic 2 | Shorthand | Address Generation | 47 | 46 | 45 | 43 | 42 | 41 | 40 | 39 | 38 | 37 | 36 | 35 | 34 | 33 | 32 | 31 |
| Mnemonic | Shorthand | Address Generation | 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
| *(Ax+#u10imm) | *Ax[#u10imm] | addr = Ax + #u10imm (#u10imm = 0 to 1KB range) | 0 | 0 | #u10imm | Ax[0-14] 1 | ||||||||||||
| *(Ax+#u10imm<<2) | *Ax[#u10imm] | addr = Ax + #u10imm<<2 (#u10imm << 2 = 0 to 4KB range, 4B steps) | 0 | 1 | #u10imm | Ax[0-14] 1 | ||||||||||||
| *(Ax+#u7imm)++Ak | *Ax[#u7imm]++Ak | addr = Ax + #u7imm, Ax = Ax + Ak (#u7imm = 0 to 128) | 1 | 0 | 0 | #u7imm | Ak[0-3] | Ax[0-14] 1 | ||||||||||
| *(A15-#n13imm) | *A15-[#n13imm] | addr = A15 - #n13imm (#n13imm = 1 to 8192) | 1 | 0 | 1 | #n13imm | ||||||||||||
| *(Ax++#u8imm) | *Ax++[#u8imm] | addr = Ax, Ax = Ax + #u8imm (#u8imm = 0 to 255 range) | 1 | 1 | 0 | 0 | #u8imm | Ax[0-14] 1 | ||||||||||
| *(Ax--#n8imm) | *Ax--[#n8imm] | addr = Ax, Ax = Ax - #n8imm (#n8imm = 1 to 256 range) | 1 | 1 | 0 | 1 | #n8imm | Ax[0-14] 1 | ||||||||||
| *(Ax-=#n8imm) | *Ax-=[#n8imm] | Ax = Ax - #n8imm, addr = Ax (#n8imm = 1 to 256 range) | 1 | 1 | 1 | 0 | #n8imm | Ax[0-14] 1 | ||||||||||
| *(Ax+Ak<<#u2imm) | *Ax[Ak] | addr = Ax + Ak << #u2imm (#u2imm = 0, 1, 2, 3) | 1 | 1 | 1 | 1 | #u2imm | 1 | 1 | 1 | 1 | Ak[0-3] | Ax[0-14] 1 | |||||
| *(Aj=(Ax+Ak<<#u2imm)) | *Aj=Ax[Ak] | addr = Ax + Ak << #u2imm, Aj = addr (#u2imm = 0, 1, 2, 3) | 1 | 1 | 1 | 1 | #u2imm | Aj[0-14] | Ak[0-3] | Ax[0-14] 1 | ||||||||
The following are the instructions that can use the ADDR1 field:
ADD.32, ADD.S16, ADD.S8, AND.16, AND.8, AND.U16, AND.U8, ANDOR.B0, ANDOR.W0, LD.32, LD.64, LD.B0, LD.B1, LD.B2, LD.B3, LD.S16, LD.S8, LD.U16, LD.U8, LD.W0, LD.W1, MV.16, MV.32, MV.64, MV.8, MV.U16, MV.U8, OR.16, OR.8, RET{D}, S16TOF, ST.16, ST.32, ST.64, ST.8, ST.B0, ST.B1, ST.B2, ST.B3, ST.W0, ST.W1, SUB.32, SUB.S16, SUB.S8, SUBR.32, SUBR.S16, SUBR.S8, U16TOF, XOR.16, XOR.8
Examples:
; Load the 32-bit value in ADDR1 into Mx, using a base address + offset
; (#u7imm) and then post increment by Ak (Ak is number of bytes to increment)
; NOTE: make sure 32-bit alignment of base address (Ax) and offset
LD.32 Mx,ADDR1 ; field
LD.32 Mx,*(Ax+#u7imm)++Ak ; addressing mode
LD.32 M1,*(A14+#100)++A2 ; actual assembly code
; OR #x16 with the address pointed to by ADDR1, and store the result
; into the location pointed to by ADDR1. Then post decrement the Ax register
; by the #n8imm value
; NOTE: make sure 16-bit alignment of base address (Ax) and offset
OR.16 ADDR1,#x16 ; field
OR.16 *Ax--[#n8imm],#x16 ; addressing mode
OR.16 *A3--[#70],#50110 ; actual assembly code