Download DK900 User Manual

Transcript
;
; Page Definition for Using the Compact Model with 64 KByte xdata RAM
;
; The following EQU statements define the xdata page used for pdata
; variables. The EQU PPAGE must conform with the PPAGE control used
; in the linker invocation.
;
PPAGEENABLE EQU
0 ; set to 1 if pdata object are used.
PPAGE
EQU
0 ; define PPAGE number.
;
;------------------------------------------------------------------------NAME ?C_STARTUP
?C_C51STARTUP SEGMENT
CODE
?STACK
SEGMENT
IDATA
RSEG
DS 1
?STACK
EXTRN CODE (?C_START)
PUBLIC
?C_STARTUP
CSEG AT 0
?C_STARTUP:
LJMP STARTUP1
;
; INT VECTORS AT HERE
;
;
;***********************************************************************
; Followings are some routines for SWAP and EXECUTE
;
EXTRN XDATA(PSD8XX_reg)
EXTRN CODE(PSDload_init, PSDload)
CSEG AT 33h
PUBLIC
RET_BOOT, EXE_MAIN
;
; Return from main flash to boot flash
;
RET_BOOT:
MOV
IE,#0
; diable all interrupts
MOV
MOV
MOVX
DPTR,#PSD8XX_reg+0E2h
A,#06h
@DPTR,A
; VM register
; both MAIN and BOOT=CODE SPACE
MOV
DPTR,#PSD8XX_reg+0E0h
; PAGE register
MOV
A,#00h
; SWAP=0, UNLOCK=0, PAGE=0
MOVX @DPTR,A
;****** now works in boot flash ********
MOV
DPTR,#PSD8xx_reg+0E2h
MOV
A,#12h
MOVX @DPTR,A
; VM register
; BOOT = CODE, MAIN = DATA space
48