English
Language : 

C517A_99 Datasheet, PDF (51/218 Pages) Siemens Semiconductor Group – 8-Bit CMOS Microcontroller
External Bus Interface
C517A
Example 1 : Using only One Datapointer (Code for a C501)
Initialization Routine
MOV
MOV
MOV
MOV
LOW(SRC_PTR), #0FFH
HIGH(SRC_PTR), #1FH
LOW(DES_PTR), #0A0H
HIGH(DES_PTR), #2FH
;Initialize shadow_variables with source_pointer
;Initialize shadow_variables with destination_pointer
Table Look-up Routine under Real Time Conditions
PUSH
PUSH
MOV
MOV
;INC
;CJNE
MOVC
MOV
MOV
MOV
MOV
INC
DPL
DPH
DPL, LOW(SRC_PTR)
DPH, HIGH(SRC_PTR)
DPTR
…
A,@DPTR
LOW(SRC_PTR), DPL
HIGH(SRC_PTR), DPH
DPL, LOW(DES_PTR)
DPH, HIGH(DES_PTR)
DPTR
MOVX
MOV
MOV
POP
POP
@DPTR, A
LOW(DES_PTR), DPL
HIGH(DES_PTR),DPH
DPH
DPL
;
Number of cycles
;Save old datapointer
2
;
2
;Load Source Pointer
2
;
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
2
;load destination_pointer
2
;
2
;
2
;Increment destination_pointer
;(ex. time not relevant)
–
;Transfer byte to destination address
2
;Save destination_pointer
2
;
2
;Restore old datapointer
2
;
2
;
Total execution time (machine cycles) : 28
Semiconductor Group
4-7