Samsung 8-Bit CMOS Microcontroller Microcassette Recorder User Manual


 
ADDRESS SPACES S3C9228/P9228
2-4
COMMON WORKING REGISTER AREA (C0H–CFH)
The SAM88RCRI register architecture provides an efficient method of working register addressing that takes full
advantage of shorter instruction formats to reduce execution time.
This16-byte address range is called common area. That is, locations in this area can be used as working registers
by operations that address any location on any page in the register file. Typically, these working registers serve
as temporary buffers for data operations between different pages.
The Register (R) addressing mode can be used to access this area
Registers are addressed either as a single 8-bit register or as a paired 16-bit register. In 16-bit register pairs, the
address of the first 8-bit register is always an even number and the address of the next register is an odd number.
The most significant byte of the 16-bit data is always stored in the even-numbered register; the least significant
byte is always stored in the next (+ 1) odd-numbered register.
MSB
Rn
LSB
Rn + 1
n = Even address
Figure 2-3. 16-Bit Register Pairs
++ PROGRAMMING TIP — Addressing the Common Working Register Area
As the following examples show, you should access working registers in the common area, locations C0H–CFH,
using working register addressing mode only.
Examples: 1. LD 0C2H,40H ; Invalid addressing mode!
Use working register addressing instead:
LD R2,40H ; R2 (C2H) the value in location 40H
2. ADD 0C3H,#45H ; Invalid addressing mode!
Use working register addressing instead:
ADD R3,#45H ; R3 (C3H) R3 + 45H