ST10R272L - SYSTEM PROGRAMMING
314/320
The EXTP (extend page) instruction allows to switch to an arbitrary data page for 1...4
instructions without having to change the current DPPs.
Example:
The EXTS (extend segment) instruction switches to a 64KByte segment oriented data
access scheme for 1...4 instructions without having to change the current DPPs. In this case
all 16 bits of the operand address are used as segment offset, with the segment taken from
the EXTS instruction. This greatly simplifies address calculation with continuous data like
huge arrays in “C”.
Example:
Note
Instructions EXTP and EXTS inhibit interrupts the same way as ATOMIC.
18.12
Short addressing in the extended SFR (ESFR) space
The short addressing modes of the ST10R272L (REG or BITOFF) implicitly access the SFR
space. Additional ESFR space would have to be accessed by long addressing modes (MEM
or [Rw]). The EXTR (extend register) instruction redirects accesses in short addressing
modes to the ESFR space for 1...4 instructions. Additional registers can also be accessed
this way.
The EXTPR and EXTSR instructions combine the DPP override mechanism with
re-direction to the ESFR space, using a single instruction.
Instructions EXTR, EXTPR and EXTSR inhibit interrupts the same way as ATOMIC.
The switch to the ESFR area, and data-page overriding is checked by the development tools
or handled automatically.
Each of the described Extension instructions and the ATOMIC instruction, starts an internal
“extension counter” counting the effected instructions. When another extension or ATOMIC
instruction is contained in the current locked sequence, this counter is re-started with the
value of the new instruction. This can be used to construct locked sequences longer than 4
instructions.
EXTP
R15, #1
;The override page number is stored in R15
MOV
R0, [R14]
;The (14-bit) page offset is stored in R14
MOV
R1, [R13]
;This instruction uses the standard DPP scheme!
EXTS
#15, #1
;The override seg. is #15 (0F’0000h...0F’FFFFh)
MOV
R0, [R14]
;The (16-bit) segment offset is stored in R14
MOV
R1, [R13]
;This instruction uses the standard DPP scheme!