📄 startup.lst
字号:
A51 MACRO ASSEMBLER STARTUP 05/04/2005 09:30:03 PAGE 1
MACRO ASSEMBLER A51 V6.20c
OBJECT MODULE PLACED IN .\ROM\STARTUP.obj
ASSEMBLER INVOKED BY: C:\Keil\C51\BIN\A51.EXE STARTUP.A51 SET(SMALL) DEBUG PRINT(.\Lst\STARTUP.lst) OBJECT(.\ROM\STARTUP
.obj) EP
LOC OBJ LINE SOURCE
1 ;------------------------------------------------------------------------------
2 ; This file is part of the C51 Compiler package
3 ; Copyright (c) 1988-1997 Keil Elektronik GmbH and Keil Software, Inc.
4 ;------------------------------------------------------------------------------
5 ; STARTUP.A51: This code is executed after processor reset.
6 ;
7 ; To translate this file use A51 with the following invocation:
8 ;
9 ; A51 STARTUP.A51
10 ;
11 ; To link the modified STARTUP.OBJ file to your application use the following
12 ; BL51 invocation:
13 ;
14 ; BL51 <your object file list>, STARTUP.OBJ <controls>
15 ;
16 ;------------------------------------------------------------------------------
17 ;
18 ; User-defined Power-On Initialization of Memory
19 ;
20 ; With the following EQU statements the initialization of memory
21 ; at processor reset can be defined:
22 ;
23 ; ; the absolute start-address of IDATA memory is always 0
0100 24 IDATALEN EQU 100H ; the length of IDATA memory in bytes.
25 ;
26 ;XDATASTART EQU 0H ; the absolute start-address of XDATA memory
27 ;XDATALEN EQU 0H ; the length of XDATA memory in bytes.
0000 28 XDATASTART EQU 0H ; the absolute start-address of XDATA memory
8000 29 XDATALEN EQU 08000H ; the length of XDATA memory in bytes.
30 ;
0000 31 PDATASTART EQU 0H ; the absolute start-address of PDATA memory
0000 32 PDATALEN EQU 0H ; the length of PDATA memory in bytes.
33 ;
34 ; Notes: The IDATA space overlaps physically the DATA and BIT areas of the
35 ; 8051 CPU. At minimum the memory space occupied from the C51
36 ; run-time routines must be set to zero.
37 ;------------------------------------------------------------------------------
38 ;
39 ; Reentrant Stack Initilization
40 ;
41 ; The following EQU statements define the stack pointer for reentrant
42 ; functions and initialized it:
43 ;
44 ; Stack Space for reentrant functions in the SMALL model.
0000 45 IBPSTACK EQU 0 ; set to 1 if small reentrant is used.
0100 46 IBPSTACKTOP EQU 0FFH+1 ; set top of stack to highest location+1.
47 ;
48 ; Stack Space for reentrant functions in the LARGE model.
0000 49 XBPSTACK EQU 0 ; set to 1 if large reentrant is used.
0000 50 XBPSTACKTOP EQU 0FFFFH+1; set top of stack to highest location+1.
51 ;
52 ; Stack Space for reentrant functions in the COMPACT model.
0000 53 PBPSTACK EQU 0 ; set to 1 if compact reentrant is used.
0000 54 PBPSTACKTOP EQU 0FFFFH+1; set top of stack to highest location+1.
55 ;
56 ;------------------------------------------------------------------------------
57 ;
A51 MACRO ASSEMBLER STARTUP 05/04/2005 09:30:03 PAGE 2
58 ; Page Definition for Using the Compact Model with 64 KByte xdata RAM
59 ;
60 ; The following EQU statements define the xdata page used for pdata
61 ; variables. The EQU PPAGE must conform with the PPAGE control used
62 ; in the linker invocation.
63 ;
0000 64 PPAGEENABLE EQU 0 ; set to 1 if pdata object are used.
0000 65 PPAGE EQU 0 ; define PPAGE number.
66 ;
67 ;------------------------------------------------------------------------------
68
69 NAME ?C_STARTUP
70
71
72 ?C_C51STARTUP SEGMENT CODE
73 ?STACK SEGMENT IDATA
74
---- 75 RSEG ?STACK
0000 76 DS 1
77
78 EXTRN CODE (?C_START)
79 PUBLIC ?C_STARTUP
80
81 ;------------------------------------------------------------------------------
---- 82 CSEG AT 0
83 ; CSEG AT 4000H
84 ;------------------------------------------------------------------------------
0000 020000 F 85 ?C_STARTUP: LJMP STARTUP1
86
---- 87 RSEG ?C_C51STARTUP
88
0000 89 STARTUP1:
90
91 IF IDATALEN <> 0
0000 78FF 92 MOV R0,#IDATALEN - 1
0002 E4 93 CLR A
0003 F6 94 IDATALOOP: MOV @R0,A
0004 D8FD 95 DJNZ R0,IDATALOOP
96 ENDIF
97
98 IF XDATALEN <> 0
0006 900000 99 MOV DPTR,#XDATASTART
0009 7F00 100 MOV R7,#LOW (XDATALEN)
101 IF (LOW (XDATALEN)) <> 0
MOV R6,#(HIGH XDATALEN) +1
ELSE
000B 7E80 104 MOV R6,#HIGH (XDATALEN)
105 ENDIF
000D E4 106 CLR A
000E F0 107 XDATALOOP: MOVX @DPTR,A
000F A3 108 INC DPTR
0010 DFFC 109 DJNZ R7,XDATALOOP
0012 DEFA 110 DJNZ R6,XDATALOOP
111 ENDIF
112
113 IF PPAGEENABLE <> 0
MOV P2,#PPAGE
ENDIF
116
117 IF PDATALEN <> 0
MOV R0,#PDATASTART
MOV R7,#LOW (PDATALEN)
CLR A
PDATALOOP: MOVX @R0,A
INC R0
DJNZ R7,PDATALOOP
A51 MACRO ASSEMBLER STARTUP 05/04/2005 09:30:03 PAGE 3
ENDIF
125
126 IF IBPSTACK <> 0
EXTRN DATA (?C_IBP)
MOV ?C_IBP,#LOW IBPSTACKTOP
ENDIF
131
132 IF XBPSTACK <> 0
EXTRN DATA (?C_XBP)
MOV ?C_XBP,#HIGH XBPSTACKTOP
MOV ?C_XBP+1,#LOW XBPSTACKTOP
ENDIF
138
139 IF PBPSTACK <> 0
EXTRN DATA (?C_PBP)
MOV ?C_PBP,#LOW PBPSTACKTOP
ENDIF
143
0014 758100 F 144 MOV SP,#?STACK-1
0017 020000 F 145 LJMP ?C_START
146
147 END
A51 MACRO ASSEMBLER STARTUP 05/04/2005 09:30:03 PAGE 4
SYMBOL TABLE LISTING
------ ----- -------
N A M E T Y P E V A L U E ATTRIBUTES
?C_C51STARTUP. . . C SEG 001AH REL=UNIT
?C_START . . . . . C ADDR ----- EXT
?C_STARTUP . . . . C ADDR 0000H A
?STACK . . . . . . I SEG 0001H REL=UNIT
IBPSTACK . . . . . N NUMB 0000H A
IBPSTACKTOP. . . . N NUMB 0100H A
IDATALEN . . . . . N NUMB 0100H A
IDATALOOP. . . . . C ADDR 0003H R SEG=?C_C51STARTUP
PBPSTACK . . . . . N NUMB 0000H A
PBPSTACKTOP. . . . N NUMB 0000H A
PDATALEN . . . . . N NUMB 0000H A
PDATASTART . . . . N NUMB 0000H A
PPAGE. . . . . . . N NUMB 0000H A
PPAGEENABLE. . . . N NUMB 0000H A
SP . . . . . . . . D ADDR 0081H A
STARTUP1 . . . . . C ADDR 0000H R SEG=?C_C51STARTUP
XBPSTACK . . . . . N NUMB 0000H A
XBPSTACKTOP. . . . N NUMB 0000H A
XDATALEN . . . . . N NUMB 8000H A
XDATALOOP. . . . . C ADDR 000EH R SEG=?C_C51STARTUP
XDATASTART . . . . N NUMB 0000H A
REGISTER BANK(S) USED: 0
ASSEMBLY COMPLETE. 0 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -