
IDATALEN        EQU     40H     ; the length of IDATA memory in bytes.

IBPSTACK        EQU     0       ; set to 1 if small reentrant is used.

IBPSTACKTOP     EQU     03FH+1  ; set top of stack to highest location+1.


                NAME    ?C_STARTUP

?C_C51STARTUP   SEGMENT   CODE
?STACK          SEGMENT   IDATA

                RSEG    ?STACK
                DS      1

                EXTRN CODE (?C_START)
                PUBLIC  ?C_STARTUP

                CSEG    AT      0
?C_STARTUP:     JMP     STARTUP1

                RSEG    ?C_C51STARTUP

STARTUP1:
<b>
IF IDATALEN <> 0 </b>
                MOV     R0,#IDATALEN - 1
                CLR     A
IDATALOOP:      MOV     @R0,A
                DJNZ    R0,IDATALOOP
ENDIF

<b>
IF IBPSTACK <> 0</b>
EXTRN DATA (?C_IBP)

                MOV     ?C_IBP,#LOW IBPSTACKTOP
ENDIF

                MOV     SP,#?STACK-1
                JMP     ?C_START

                END
