DS80C320-ECD DALLAS [Dallas Semiconductor], DS80C320-ECD Datasheet - Page 64

no-image

DS80C320-ECD

Manufacturer Part Number
DS80C320-ECD
Description
High-Speed Microcontroller User Guide
Manufacturer
DALLAS [Dallas Semiconductor]
Datasheet
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.
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.
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.
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.
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.
ANL
PUSH
MOVX
MOVX
ORL
A, @R0
A
@R0, A
@DPTR, A
A, #40h
;Logical AND the Accumulator
;with the contents of the register
;pointed to by the value stored in R0.
;Saves the contents of the
;accumulator on the stack.
;Write the value in the accumulator
;to the address pointed to by R0 in
;the page pointed to by P2.
;Write the value in the accumulator
;to the address referenced by the
;selected data pointer.
;Logical OR the Accumulator with 40h.
64 of 175
High-Speed Microcontroller User’s Guide

Related parts for DS80C320-ECD