English
Language : 

DS80C320-MCG Datasheet, PDF (64/175 Pages) Dallas Semiconductor – High-Speed Microcontroller User Guide
High-Speed Microcontroller User’s Guide
Register Indirect Addressing
This mode is used to access the Scratchpad RAM locations above 7Fh. It can also be used to reach the
lower RAM (0h - 7Fh) if needed. The address is supplied by the contents of the Working Register
specified in the instruction. Thus one instruction can be used to reach many values by altering the
contents of the designated Working Register. Note that in general, only R0 and R1 can be used as
pointers. An example of Register Indirect Addressing is as follows.
ANL
A, @R0 ;Logical AND the Accumulator
;with the contents of the register
;pointed to by the value stored in R0.
This mode is also used for Stack manipulation. This is because all Stack references are directed by the
value in the Stack Pointer register. The Push and Pop instructions use this method of addressing. An
example is as follows.
PUSH
A
;Saves the contents of the
;accumulator on the stack.
Register Indirect Addressing is used for all off-chip data memory accesses. These involve the MOVX
instruction. The pointer registers can be R0, R1, DPTR0 and DPTR1. Both R0 and R1 reside in the
Working Register area of the Scratchpad RAM. They can be used to reference a 256 byte area of off-chip
data memory. When using this type of addressing, the upper address byte is supplied by the value in the
Port 2 latch. This value must be selected by software prior to the MOVX instruction. An example is as
follows.
MOVX
@R0, A
;Write the value in the accumulator
;to the address pointed to by R0 in
;the page pointed to by P2.
The 16-bit Data pointers (DPTRs) can be used as an absolute off-chip reference. This gives access to the
entire 64KB data memory map. An example is as follows.
MOVX
@DPTR, A ;Write the value in the accumulator
;to the address referenced by the
;selected data pointer.
Immediate Addressing
Immediate Addressing is used when one of the operands is predetermined and coded into the software.
This mode is commonly used to initialize SFRs and to mask particular bits without affecting others. An
example is as follows.
ORL
A, #40h ;Logical OR the Accumulator with 40h.
64 of 175