📄 startup.lst
字号:
A51 MACRO ASSEMBLER STARTUP 08/05/2007 21:31:20 PAGE 1
MACRO ASSEMBLER A51 V8.00
OBJECT MODULE PLACED IN .\Out File\STARTUP.obj
ASSEMBLER INVOKED BY: C:\Keil\C51\BIN\A51.EXE C51Port\STARTUP.A51 SET(LARGE) DEBUG PRINT(.\Out File\STARTUP.lst) OBJECT(
.\Out File\STARTUP.obj) EP
LOC OBJ LINE SOURCE
1 $nomod51
2 ;------------------------------------------------------------------------------
3 ; This file is part of the C51 Compiler package
4 ; Copyright (c) 1988-2001 Keil Elektronik GmbH and Keil Software, Inc.
5 ;------------------------------------------------------------------------------
6 ; STARTUP.A51: This code is executed after processor reset.
7 ;
8 ; To translate this file use A51 with the following invocation:
9 ;
10 ; A51 STARTUP.A51
11 ;
12 ; To link the modified STARTUP.OBJ file to your application use the following
13 ; BL51 invocation:
14 ;
15 ; BL51 <your object file list>, STARTUP.OBJ <controls>
16 ;
17 ;------------------------------------------------------------------------------
18 ;
19 ; User-defined Power-On Initialization of Memory
20 ;
21 ; With the following EQU statements the initialization of memory
22 ; at processor reset can be defined:
23 ;
24 ; ; the absolute start-address of IDATA memory is always 0
00FF 25 IDATALEN EQU 0FFH ; the length of IDATA memory in bytes.
26 ;
0000 27 PDATASTART EQU 0H ; the absolute start-address of PDATA memory
0000 28 PDATALEN EQU 00H ; the length of PDATA memory in bytes.
29 ;
0000 30 XDATASTART EQU 0H ; the absolute start-address of XDATA memory
1000 31 XDATALEN EQU 0FFFH+1 ; the length of XDATA memory in bytes.
32 ;
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.
0000 46 IBPSTACKTOP EQU 0H ; set top of stack to highest location+1.
47 ;
48 ; Stack Space for reentrant functions in the COMPACT model.
0000 49 PBPSTACK EQU 0 ; set to 1 if compact reentrant is used.
00FF 50 PBPSTACKTOP EQU 0FFH ; set top of stack to highest location+1.
51 ;
52 ; Stack Space for reentrant functions in the LARGE model.
0001 53 XBPSTACK EQU 1 ; set to 1 if large reentrant is used.
1000 54 XBPSTACKTOP EQU 1000H ; set top of stack to highest location+1.
55 ;注意在include.h文件中也要修改XBPSTACKTOP
56 ;
57
A51 MACRO ASSEMBLER STARTUP 08/05/2007 21:31:20 PAGE 2
58 ;------------------------------------------------------------------------------
59 ;
60 ; Page Definition for Using the Compact Model with 64 KByte xdata RAM
61 ;
62 ; The following EQU statements define the xdata page used for pdat
63 ; variables. The EQU PPAGE must conform with the PPAGE control used
64 ; in the linker invocation.
65 ;
0000 66 PPAGEENABLE EQU 0 ; set to 1 if pdat object are used.
00FF 67 PPAGE EQU 0FFh ; define PPAGE number.
68 ;
69 ;------------------------------------------------------------------------------
70
71 ; Standard SFR Symbols required in XBANKING.A51
00E0 72 ACC DATA 0E0H
00F0 73 B DATA 0F0H
00A0 74 P2 DATA 0A0h
0081 75 SP DATA 81H
0082 76 DPL DATA 82H
0083 77 DPH DATA 83H
78
79 NAME ?C_STARTUP
80
81 PUBLIC STACK
82
83 ?C_C51STARTUP SEGMENT CODE
84 ?STACK SEGMENT IDATA
---- 85 RSEG ?STACK
0000 86 STACK:
0000 87 DS 1
88
89 EXTRN CODE (?C_START)
90 PUBLIC ?C_STARTUP
91
---- 92 CSEG AT 0
0000 020000 F 93 ?C_STARTUP: LJMP STARTUP1
94
---- 95 RSEG ?C_C51STARTUP
96
0000 97 STARTUP1:
98
99 IF IDATALEN <> 0
0000 78FF 100 MOV R0,#IDATALEN
0002 E4 101 CLR A
0003 F6 102 IDATALOOP: MOV @R0,A
0004 D8FD 103 DJNZ R0,IDATALOOP
104 ENDIF
105
106 IF XDATALEN <> 0
0006 900000 107 MOV DPTR,#XDATASTART
0009 7F00 108 MOV R7,#LOW (XDATALEN)
000B 7E10 109 MOV R6,#HIGH (XDATALEN)
000D E4 110 CLR A
000E F0 111 XDATALOOP: MOVX @DPTR,A
000F A3 112 INC DPTR
0010 DFFC 113 DJNZ R7,XDATALOOP
0012 DEFA 114 DJNZ R6,XDATALOOP
115 ENDIF
116
117 IF PPAGEENABLE <> 0
MOV P2,#PPAGE
ENDIF
120
121 IF PDATALEN <> 0
MOV R0,#PDATASTART
MOV R7,#LOW (PDATALEN)
A51 MACRO ASSEMBLER STARTUP 08/05/2007 21:31:20 PAGE 3
CLR A
PDATALOOP: MOVX @R0,A
INC R0
DJNZ R7,PDATALOOP
ENDIF
129
130 IF IBPSTACK <> 0
EXTRN DATA (?C_IBP)
MOV ?C_IBP,#LOW IBPSTACKTOP
ENDIF
135
136 IF XBPSTACK <> 0
137 EXTRN DATA (?C_XBP)
138
0014 750010 F 139 MOV ?C_XBP,#HIGH XBPSTACKTOP
0017 750000 F 140 MOV ?C_XBP+1,#LOW XBPSTACKTOP
141 ENDIF
142
143 IF PBPSTACK <> 0
EXTRN DATA (?C_PBP)
MOV ?C_PBP,#LOW PBPSTACKTOP
ENDIF
147
001A 758100 F 148 MOV SP,#STACK-1
149 ; This code is required if you use L51_BANK.A51 with Banking Mode 4
150 ; EXTRN CODE (?B_SWITCH0)
151 ; CALL ?B_SWITCH0 ; init bank mechanism to code bank 0
001D 020000 F 152 LJMP ?C_START
153
154 END
A51 MACRO ASSEMBLER STARTUP 08/05/2007 21:31:20 PAGE 4
SYMBOL TABLE LISTING
------ ----- -------
N A M E T Y P E V A L U E ATTRIBUTES
?C_C51STARTUP. . . C SEG 0020H REL=UNIT
?C_START . . . . . C ADDR ----- EXT
?C_STARTUP . . . . C ADDR 0000H A
?C_XBP . . . . . . D ADDR ----- EXT
?STACK . . . . . . I SEG 0001H REL=UNIT
ACC. . . . . . . . D ADDR 00E0H A
B. . . . . . . . . D ADDR 00F0H A
DPH. . . . . . . . D ADDR 0083H A
DPL. . . . . . . . D ADDR 0082H A
IBPSTACK . . . . . N NUMB 0000H A
IBPSTACKTOP. . . . N NUMB 0000H A
IDATALEN . . . . . N NUMB 00FFH A
IDATALOOP. . . . . C ADDR 0003H R SEG=?C_C51STARTUP
P2 . . . . . . . . D ADDR 00A0H A
PBPSTACK . . . . . N NUMB 0000H A
PBPSTACKTOP. . . . N NUMB 00FFH A
PDATALEN . . . . . N NUMB 0000H A
PDATASTART . . . . N NUMB 0000H A
PPAGE. . . . . . . N NUMB 00FFH A
PPAGEENABLE. . . . N NUMB 0000H A
SP . . . . . . . . D ADDR 0081H A
STACK. . . . . . . I ADDR 0000H R SEG=?STACK
STARTUP1 . . . . . C ADDR 0000H R SEG=?C_C51STARTUP
XBPSTACK . . . . . N NUMB 0001H A
XBPSTACKTOP. . . . N NUMB 1000H A
XDATALEN . . . . . N NUMB 1000H 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 + -