;*****************************************************************************

;* __CSTART

;*****************************************************************************

__CSTART_PR SECTION CODE WORD PUBLIC ‘CPROGRAM’

__CSTART PROC TASK __CSTART_TASK INTNO __CSTART_INUM = 00H

DISWDT ; Disable watchdog timer.

; Set SYSCON register.

BFLDL SYSCON, #SYSC_M_L, #(SYSC_L AND SYSC_M_L)

BFLDH SYSCON, #SYSC_M_H, #(SYSC_H AND SYSC_M_H)

BSET    SYSCON.2                    ; Set XPEN *** INSERTED ***

; BFLDH SYSCON, #SYSC_M_H, #(SYSC_H AND SYSC_M_H)

@IF( @C167 )

;Set BUSCON0 register

BFLD BUSCON0, #BUSC0_M_L, #(BUSC0_L AND BUSC0_M_L)

BFLDH BUSCON0,#BUSC0_M_H,#(BUSC0_H AND BUSC0_M_H)

@ENDI

MOV STKOV,#?SYSSTACK_BOTTOM+6*2;Set stack underflow pointer.

MOV STKUN, #?SYSSTACK_TOP ; Set stack overflow pointer.

MOV SP, #?SYSSTACK_TOP ; Set stack pointer.

MOV CP, #RBANK ; Set context pointer.