English
Language : 

DS80C320-MCG Datasheet, PDF (63/175 Pages) Dallas Semiconductor – High-Speed Microcontroller User Guide
High-Speed Microcontroller User’s Guide
Register Addressing
Register Addressing is used for operands that are located in one of the eight Working Registers (R7-R0).
These are the currently selected Working Register bank, which reside in the lower 32 bytes of Scratchpad
RAM. A register bank is selected using two bits in the Program Status Word (PSW;D0h). This
addressing mode is powerful, since it uses the active bank without knowing which bank is selected. Thus
one instruction can have multiple uses by simply switching banks. Register Addressing is also a high-
speed instruction, requiring only one machine cycle. Two examples of Register Addressing are provided
below.
ADD
A, R4
;Add Accumulator to register R4
INC
R2
;Increment the value in register R2
In the first case, the value in R4 is the source of the operation. In the later, R2 is the destination. These
instructions do not consider the absolute address of the register. They will act on whichever bank has
been selected.
Any Working Register may also be accessed by Direct Addressing, described below. To do this, the
absolute address must be specified.
Direct Addressing
Direct Addressing is the mode used to access the entire lower 128 bytes of Scratchpad RAM and the SFR
area. It is commonly used to move the value in one register to another. Two examples are shown below.
MOV
72h, 74h ;Move the value in register 74 to
;register 72.
MOV
90h, 20h ;Move the value in register 20 to
;the SFR at 90h (Port 1)
Note that there is no instruction difference between a RAM access and an SFR access. The SFRs are
simply register locations above 7Fh.
Direct Addressing also extends to bit addressing. There is a group of instructions that explicitly use bits.
The address information provided to such an instruction is the bit location, rather than the register
address. Registers between 20h and 2Fh contain bits that are individually addressable. SFRs that end in
0 or 8 are bit addressable. An example of Direct Bit Addressing is as follows.
SETB
00h
;Set bit 00 in the RAM. This is the
;LSb of the register at address 20h
;as shown in Section 4.
MOV
C, 0B7h ;Move the contents of bit B7 to the
;Carry flag. Bit B7 is the MSb of
;register B0 (Port 3).
63 of 175