📄 startup.lst
字号:
A51 MACRO ASSEMBLER STARTUP 11/04/2008 18:45:35 PAGE 1
MACRO ASSEMBLER A51 V8.00d
OBJECT MODULE PLACED IN STARTUP.OBJ
ASSEMBLER INVOKED BY: C:\Keil\C51\BIN\a51.exe STARTUP.A51 XR GEN DB EP NOMOD51
LOC OBJ LINE SOURCE
1 $nomod51
2
3 ;------------------------------------------------------------------------------
4 ; This file is part of the C51 Compiler package
5 ; Copyright (c) 1988-2002 Keil Elektronik GmbH and Keil Software, Inc.
6 ;------------------------------------------------------------------------------
7 ; STARTUP.A51: This code is executed after processor reset.
8 ;
9 ; To translate this file use A51 with the following invocation:
10 ;
11 ; A51 STARTUP.A51
12 ;
13 ; To link the modified STARTUP.OBJ file to your application use the following
14 ; BL51 invocation:
15 ;
16 ; BL51 <your object file list>, STARTUP.OBJ <controls>
17 ;
18 ;------------------------------------------------------------------------------
19 ;
20 ; User-defined Power-On Initialization of Memory
21 ;
22 ; With the following EQU statements the initialization of memory
23 ; at processor reset can be defined:
24 ;
25 ; ; the absolute start-address of IDATA memory is always 0
0080 26 IDATALEN EQU 80H ; the length of IDATA memory in bytes.
27 ;
0000 28 XDATASTART EQU 0H ; the absolute start-address of XDATA memory
0000 29 XDATALEN EQU 0H ; 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 ;
58 ; Page Definition for Using the Compact Model with 64 KByte xdata RAM
A51 MACRO ASSEMBLER STARTUP 11/04/2008 18:45:35 PAGE 2
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.
65 ;
0000 66 PPAGE EQU 0 ; define PPAGE number.
67 ;
00A0 68 PPAGE_SFR DATA 0A0H ; SFR that supplies uppermost address byte
69 ; (most 8051 variants use P2 as uppermost address byte)
70 ;
71 ;------------------------------------------------------------------------------
72
73 ; Standard SFR Symbols
00E0 74 ACC DATA 0E0H
00F0 75 B DATA 0F0H
0081 76 SP DATA 81H
0082 77 DPL DATA 82H
0083 78 DPH DATA 83H
00D9 79 PCA0MD DATA 0D9h
80
81 NAME ?C_STARTUP
82
83
84 ?C_C51STARTUP SEGMENT CODE
85 ?STACK SEGMENT IDATA
86
---- 87 RSEG ?STACK
0000 88 DS 1
89
90 EXTRN CODE (?C_START)
91 PUBLIC ?C_STARTUP
92
93 ;------------------------------
94 ; Reset Vector
95 ;------------------------------
96
97 ; Reset Vector @ 0x0000
---- 98 CSEG AT 000h
0000 020000 F 99 ?C_STARTUP: LJMP STARTUP1
100
101
102 ;------------------------------
103 ; User Startup Code
104 ;------------------------------
105
---- 106 RSEG ?C_C51STARTUP
107
0000 108 STARTUP1:
109
110 ; Disable Watchdog Timer
0000 75D900 111 MOV PCA0MD , #000h
112
113 ;------------------------------
114 ; Standard Startup Code
115 ;------------------------------
116
117 ; Initialize RAM (startup.a51 unmodified beyond this point)
118 IF IDATALEN <> 0
0003 787F 119 MOV R0,#IDATALEN - 1
0005 E4 120 CLR A
0006 F6 121 IDATALOOP: MOV @R0,A
0007 D8FD 122 DJNZ R0,IDATALOOP
123 ENDIF
124
A51 MACRO ASSEMBLER STARTUP 11/04/2008 18:45:35 PAGE 3
125 IF XDATALEN <> 0
MOV DPTR,#XDATASTART
MOV R7,#LOW (XDATALEN)
IF (LOW (XDATALEN)) <> 0
MOV R6,#(HIGH (XDATALEN)) +1
ELSE
MOV R6,#HIGH (XDATALEN)
ENDIF
CLR A
XDATALOOP: MOVX @DPTR,A
INC DPTR
DJNZ R7,XDATALOOP
DJNZ R6,XDATALOOP
ENDIF
139
140 IF PPAGEENABLE <> 0
MOV PPAGE_SFR,#PPAGE
ENDIF
143
144 IF PDATALEN <> 0
MOV R0,#LOW (PDATASTART)
MOV R7,#LOW (PDATALEN)
CLR A
PDATALOOP: MOVX @R0,A
INC R0
DJNZ R7,PDATALOOP
ENDIF
152
153 IF IBPSTACK <> 0
EXTRN DATA (?C_IBP)
MOV ?C_IBP,#LOW IBPSTACKTOP
ENDIF
158
159 IF XBPSTACK <> 0
EXTRN DATA (?C_XBP)
MOV ?C_XBP,#HIGH XBPSTACKTOP
MOV ?C_XBP+1,#LOW XBPSTACKTOP
ENDIF
165
166 IF PBPSTACK <> 0
EXTRN DATA (?C_PBP)
MOV ?C_PBP,#LOW PBPSTACKTOP
ENDIF
170
0009 758100 F 171 MOV SP,#?STACK-1
172 ; This code is required if you use L51_BANK.A51 with Banking Mode 4
173 ; EXTRN CODE (?B_SWITCH0)
174 ; CALL ?B_SWITCH0 ; init bank mechanism to code bank 0
000C 020000 F 175 LJMP ?C_START
176
177 END
A51 MACRO ASSEMBLER STARTUP 11/04/2008 18:45:35 PAGE 4
XREF SYMBOL TABLE LISTING
---- ------ ----- -------
N A M E T Y P E V A L U E ATTRIBUTES / REFERENCES
?C_C51STARTUP. . . C SEG 000FH REL=UNIT 84# 106
?C_START . . . . . C ADDR ----- EXT 90# 175
?C_STARTUP . . . . C ADDR 0000H A 81 91 99#
?STACK . . . . . . I SEG 0001H REL=UNIT 85# 87 171
ACC. . . . . . . . D ADDR 00E0H A 74#
B. . . . . . . . . D ADDR 00F0H A 75#
DPH. . . . . . . . D ADDR 0083H A 78#
DPL. . . . . . . . D ADDR 0082H A 77#
IBPSTACK . . . . . N NUMB 0000H A 45# 153
IBPSTACKTOP. . . . N NUMB 0100H A 46#
IDATALEN . . . . . N NUMB 0080H A 26# 118 119
IDATALOOP. . . . . C ADDR 0006H R SEG=?C_C51STARTUP 121# 122
PBPSTACK . . . . . N NUMB 0000H A 53# 166
PBPSTACKTOP. . . . N NUMB 0000H A 54#
PCA0MD . . . . . . D ADDR 00D9H A 79# 111
PDATALEN . . . . . N NUMB 0000H A 32# 144
PDATASTART . . . . N NUMB 0000H A 31#
PPAGE. . . . . . . N NUMB 0000H A 66#
PPAGEENABLE. . . . N NUMB 0000H A 64# 140
PPAGE_SFR. . . . . D ADDR 00A0H A 68#
SP . . . . . . . . D ADDR 0081H A 76# 171
STARTUP1 . . . . . C ADDR 0000H R SEG=?C_C51STARTUP 99 108#
XBPSTACK . . . . . N NUMB 0000H A 49# 159
XBPSTACKTOP. . . . N NUMB 0000H A 50#
XDATALEN . . . . . N NUMB 0000H A 29# 125 128
XDATASTART . . . . N NUMB 0000H A 28#
REGISTER BANK(S) USED: 0
ASSEMBLY COMPLETE. 0 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -