English
Language : 

UPSD3354DV-40U6 Datasheet, PDF (48/272 Pages) STMicroelectronics – fast 8032 MCU with programmable logic
8032 addressing modes
UPSD33xx
MOVX @R0,A
; Move into the accumulator the
; XDATA that is pointed to by
; the address contained in R0.
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
adding either the 16-bit PC or DPTR value to the contents of the accumulator. The value in
the accumulator is referred to as an index. The data fetched from the final location in
program memory is stored into the accumulator, overwriting the index value that was
previously stored there. For example:
MOVC A, @A+DPTR
; Move code byte relative to
t(s) MOVC A, @A+PC
; DPTR into accumulator
; Move code byte relative to PC
; into accumulator
roduc 9.8
Relative addressing
P This mode will add the two’s-compliment number stored in the second byte of the instruction
te to the program counter for short jumps within +128 or –127 addresses relative to the
le program counter. This is commonly used for looping and is very efficient since no additional
bus cycle is needed to fetch the jump destination address. For example:
t(s) - Obso SJMP 34h
; Jump 34h bytes ahead (in program
; memory) of the address at which
; the SJMP instruction is stored. If
; SJMP is at 1000h, program
; execution jumps to 1034h.
roduc 9.9
Absolute addressing
P This mode will append the 5 high-order bits of the address of the next instruction to the 11
telow-order bits of an ACALL or AJUMP instruction to produce a 16-bit jump address. The
lejump will be within the same 2 Kbyte page of program memory as the first byte of the
o following instruction. For example:
Obs AJMP 0500h
; If next instruction is located at
; address 4000h, the resulting jump
; will be made to 4500h.
48/272
Doc ID 9685 Rev 7