English
Language : 

C508_01 Datasheet, PDF (51/267 Pages) Infineon Technologies AG – 8-Bit CMOS Microcontroller
C508
Example 2: Using Two Datapointers (Code for a C508)
External Bus Interface
Initialization Routine
MOV DPSEL, #06H
MOV DPTR, #1FFFH
MOV DPSEL, #07H
MOV DPTR, #2FA0H
;Initialize DPTR6 with source pointer
;Initialize DPTR7 with destination pointer
Table Look-up Routine under Real Time Conditions
PUSH
MOV
INC
DPSEL
DPSEL, #06H
DPTR
CJNE
MOVC
MOV
…
A,@DPTR
DPSEL, #07H
MOVX @DPTR, A
POP DPSEL
;
Number of cycles
;Save old source pointer
2
;Load source pointer
2
;Increment and check for end of table
;(execution time
;not relevant for this consideration) –
;Fetch source data byte from ROM table 2
;Save source_pointer and
;load destination_pointer
2
;Transfer byte to destination address 2
;Save destination pointer and
;restore old datapointer
2
;Total execution time (machine cycles): 12
The example above shows that utilization of the C508’s multiple datapointers can make
external bus accesses twice 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, as
well. For some applications in which all eight datapointers are employed, this means that
a C508 program has up to 24 bytes (16 variables and 8 stack bytes) of the internal RAM
available for other uses.
User’s Manual
4-9
2001-05