Non-Contiguous 16-Byte Working Register Block; Using The Rps To Calculate The Sum Of A Series Of Registers - Samsung S3C8275X User Manual

8-bit cmos microcontrollers
Table of Contents

Advertisement

ADDRESS SPACES
1 1 1 1 0
RP0
0 0 0 0 0
RP1
PROGRAMMING TIP — Using the RPs to Calculate the Sum of a Series of Registers
Calculate the sum of registers 80H–85H using the register pointer. The register addresses from 80H through 85H
contain the values 10H, 11H, 12H, 13H, 14H, and 15H respectively:
SRP0
ADD
ADC
ADC
ADC
ADC
The sum of these six registers, 6FH, is located in the register R0 (80H). The instruction string used in this
example takes 12 bytes of instruction code and its execution time is 36 cycles. If the register pointer is not used to
calculate the sum of these registers, the following instruction sequence would have to be used:
ADD
ADC
ADC
ADC
ADC
Now, the sum of the six registers is also located in register 80H. However, this instruction string takes 15 bytes of
instruction code rather than 12 bytes, and its execution time is 50 cycles rather than 36 cycles.
2-14
X X X
X X X
Figure 2-9. Non-Contiguous 16-Byte Working Register Block
#80H
R0,R1
R0,R2
R0,R3
R0,R4
R0,R5
80H,81H
80H,82H
80H,83H
80H,84H
80H,85H
S3C8275X/F8275X/C8278X/F8278X/C8274X/F8274X
8-Byte Slice
Register File
Contains 32
8-Byte Slices
8-Byte Slice
; RP0 ← 80H
; R0 ← R0 + R1
; R0 ← R0 + R2 + C
; R0 ← R0 + R3 + C
; R0 ← R0 + R4 + C
; R0 ← R0 + R5 + C
; 80H ← (80H) + (81H)
; 80H ← (80H) + (82H) + C
; 80H ← (80H) + (83H) + C
; 80H ← (80H) + (84H) + C
; 80H ← (80H) + (85H) + C
F7H (R7)
F0H (R0)
16-Byte
Contiguous
working
Register block
7H (R15)
0H (R0)

Advertisement

Table of Contents
loading

This manual is also suitable for:

F8275xF8274xC8278xC8274xF8278x

Table of Contents