$NOMOD51
NAME    ?C_STARTUP

EXTRN CODE (?C_START)
PUBLIC  ?C_STARTUP
IDATALEN        EQU     100H
CLKCON	EQU	0B2H
SSP_LEN EQU 0x1000          //偏移到4K的起始位置

	ISEG	AT	0x80
STACK:	DS	128
	
	CSEG	AT	0
?C_STARTUP:
	LJMP	STARTUP1

	?C_C51STARTUP	SEGMENT	CODE
					RSEG	?C_C51STARTUP
STARTUP1:
	MOV     SP, #STACK-1
	MOV		CLKCON, #08H	;SETB HFON
	NOP
	NOP
	NOP
	NOP
	NOP
	NOP
	NOP
	NOP
	ORL		CLKCON, #04H		;SETB FS, SYSCLK=24M
    
IF IDATALEN <> 0
                MOV     R0,#IDATALEN - 1
                CLR     A
IDATALOOP:      MOV     @R0,A
                DJNZ    R0,IDATALOOP
ENDIF
    
	LJMP    ?C_START




	CSEG	AT	00003H
	LJMP	SSP_LEN+00003H
	
	CSEG	AT	0000BH
	LJMP	SSP_LEN+0000BH
	
	CSEG	AT	00013H
	LJMP	SSP_LEN+00013H
	
	CSEG	AT	0001BH
	LJMP	SSP_LEN+0001BH
	
	CSEG	AT	00023H	
	LJMP	SSP_LEN+00023H
	
	CSEG	AT	0002BH
	LJMP	SSP_LEN+0002BH
	
	CSEG	AT	00033H
	LJMP	SSP_LEN+00033H
	
	CSEG	AT	0003BH
	LJMP	SSP_LEN+0003BH
	
	CSEG	AT	00043H
	LJMP	SSP_LEN+00043H
	
	CSEG	AT	0004BH
	LJMP	SSP_LEN+0004BH
	
	CSEG	AT	00053H
	LJMP	SSP_LEN+00053H
	
	CSEG	AT	0005BH
	LJMP	SSP_LEN+0005BH
	
	CSEG	AT	00063H
	LJMP	SSP_LEN+00063H
	
	CSEG	AT	0006BH
	LJMP	SSP_LEN+0006BH
	
	CSEG	AT	00073H
	LJMP	SSP_LEN+00073H
	
	CSEG	AT	0007BH
	LJMP	SSP_LEN+0007BH
	
	CSEG	AT	00083H
	LJMP	SSP_LEN+00083H
	
	CSEG	AT	0008BH
	LJMP	SSP_LEN+0008BH
	
	CSEG	AT	00093H
	LJMP	SSP_LEN+00093H
	
	CSEG	AT	0009BH
	LJMP	SSP_LEN+0009BH
	
	CSEG	AT	000A3H
	LJMP	SSP_LEN+000A3H

	CSEG	AT	(1000H-200H)
FlagCode:	DS	512

END