Siemens C500 User Manual page 17

Microcontroller family
Table of Contents

Advertisement

Example 2 : Using Two Datapointers (Code for a C509)
Initialization Routine
MOV
DPSEL, #06H
MOV
DPTR, #1FFFH
MOV
DPSEL, #07H
MOV
DPTR, #2FA0H
Table Look-up Routine under Real Time Conditions
PUSH
DPSEL
MOV
DPSEL, #06H
;INC
DPTR
;CJNE
É
MOVC
A,@DPTR
MOV
DPSEL, #07H
MOVX
@DPTR, A
POP
DPSEL
;
The above example shows that utilization of the C500Õs multiple datapointers can make external
bus accesses two times as fast as with a standard 8051 or 8051 derivative. Here, four data variables
in the internal RAM and two additional stack bytes were spared, too. This means for some
applications where all eight datapointers are employed that an C500 program has up to 24 byte (16
variables and 8 stack bytes) of the internal RAM free for other use.
Semiconductor Group
;Initialize DPTR6 with source pointer
;Initialize DPTR7 with destination pointer
;
;Save old source pointer
;Load source pointer
Increment and check for end of table (execution time
not relevant for this consideration)
;Fetch source data byte from ROM table
;Save source_pointer and
;load destination_pointer
;Transfer byte to destination address
;Save destination pointer and
;restore old datapointer
Total execution time (machine cycles) :
2-8
CPU Functions
C500 Family
Number of cycles
2
2
Ð
2
2
2
2
12
1998-04-01

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents