English
Language : 

UPSD3422_06 Datasheet, PDF (39/293 Pages) STMicroelectronics – Turbo Plus Series Fast Turbo 8032 MCU with USB and Programmable Logic
uPSD34xx
8032 addressing modes
9.4
Immediate Addressing
This mode uses 8-bits of data (a constant) contained in the second byte of the instruction,
and stores it into the memory location or register indicated by the first byte of the instruction.
Thus, the data is immediately available within the instruction. This mode is commonly used
to initialize registers and SFRs or to perform mask operations.
There is also a 16-bit version of this mode for loading the DPTR Register. In this case, the
two bytes following the instruction byte contain the 16-bit value. For example:
MOV A, 40#
; Move the constant, 40h, into
; the accumulator
MOV DPTR, 1234#
; Move the constant, 1234h, into
; DPTR
9.5
Note:
9.6
Note:
External Direct Addressing
This mode will access external memory (XDATA) by using the 16-bit address stored in the
DPTR Register. There are only two instructions using this mode and both use the
accumulator to either receive a byte from external memory addressed by DPTR or to send a
byte from the accumulator to the address in DPTR. The uPSD34xx has a special feature to
alternate the contents (source and destination) of DPTR rapidly to implement very efficient
memory-to-memory transfers. For example:
MOVX A, @DPTR
; Move contents of accumulator to
; XDATA at address contained in
; DPTR
MOVX @DPTR, A
; Move XDATA to accumulator
See details in Section 11: Dual data pointers on page 47.
External Indirect Addressing
This mode will access external memory (XDATA) by using the 8-bit address stored in either
Register R0 or R1. This is the fastest way to access XDATA (least bus cycles), but because
only 8-bits are available for address, this mode limits XDATA to a size of only 256 bytes (the
traditional Port 2 of the 8032 MCU is not available in the uPSD34xx, so it is not possible to
write the upper address byte).
For example:
MOVX @R0,A
; Move into the accumulator the
; XDATA that is pointed to by
; the address contained in R0.
This mode is not supported by uPSD34xx.
9.7
Indexed Addressing
This mode is used for the MOVC instruction which allows the 8032 to read a constant from
program memory (not data memory). MOVC is often used to read look-up tables that are
embedded in program memory. The final address produced by this mode is the result of
39/293