📄 startup.lst
字号:
A51 MACRO ASSEMBLER STARTUP 06/20/2005 16:55:58 PAGE 1
MACRO ASSEMBLER A51 V7.10
OBJECT MODULE PLACED IN STARTUP.OBJ
ASSEMBLER INVOKED BY: C:\Keil\C51\BIN\A51.EXE STARTUP.A51 SET(SMALL) DEBUG EP
LOC OBJ LINE SOURCE
1 $nomod51
2 ;------------------------------------------------------------------------------
3 ; This file is part of the C51 Compiler package
4 ; Copyright (c) 1988-2002 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 EXTRN DATA (bootflag)
24 ;
25 ; ; the absolute start-address of IDATA memory is always 0
0100 26 IDATALEN EQU 100H ; 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 06/20/2005 16:55:58 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
79
80 NAME ?C_STARTUP
81
82
83 ?C_C51STARTUP SEGMENT CODE
84 ?STACK SEGMENT IDATA
85
---- 86 RSEG ?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
0000 E500 F 99 MOV A, bootflag ; check if RAM is good
0002 B4AA02 100 CJNE A, #0AAH, CLRMEM
0005 8008 101 SJMP CLRCOMP ; RAM is good, clear only
102 ; compiler owned locations
103 ; RAM was not good,
0007 104 CLRMEM: ; clear bootflag
105 IF IDATALEN <> 0
0007 78FF 106 MOV R0,#IDATALEN - 1
0009 E4 107 CLR A
000A F6 108 IDATALOOP1: MOV @R0,A
000B D8FD 109 DJNZ R0,IDATALOOP1
000D 8008 110 JMP CLRXDATA;;
111 ENDIF
000F 112 CLRCOMP:
000F E4 113 CLR A
114 ;MOV 21H,A
0010 780A 115 MOV R0,#0AH
0012 F6 116 L1: MOV @R0,A
0013 08 117 INC R0
0014 B8FFFB 118 CJNE R0,#0FFH,L1
0017 119 CLRXDATA:
120
121 IF XDATALEN <> 0
MOV DPTR,#XDATASTART
MOV R7,#LOW (XDATALEN)
IF (LOW (XDATALEN)) <> 0
A51 MACRO ASSEMBLER STARTUP 06/20/2005 16:55:58 PAGE 3
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
135
136 IF PPAGEENABLE <> 0
MOV PPAGE_SFR,#PPAGE
ENDIF
139
140 IF PDATALEN <> 0
MOV R0,#LOW (PDATASTART)
MOV R7,#LOW (PDATALEN)
CLR A
PDATALOOP: MOVX @R0,A
INC R0
DJNZ R7,PDATALOOP
ENDIF
148
149 IF IBPSTACK <> 0
EXTRN DATA (?C_IBP)
MOV ?C_IBP,#LOW IBPSTACKTOP
ENDIF
154
155 IF XBPSTACK <> 0
EXTRN DATA (?C_XBP)
MOV ?C_XBP,#HIGH XBPSTACKTOP
MOV ?C_XBP+1,#LOW XBPSTACKTOP
ENDIF
161
162 IF PBPSTACK <> 0
EXTRN DATA (?C_PBP)
MOV ?C_PBP,#LOW PBPSTACKTOP
ENDIF
166
0017 758100 F 167 MOV SP,#?STACK-1
168 ; This code is required if you use L51_BANK.A51 with Banking Mode 4
169 ; EXTRN CODE (?B_SWITCH0)
170 ; CALL ?B_SWITCH0 ; init bank mechanism to code bank 0
001A 020000 F 171 LJMP ?C_START
172
173 END
A51 MACRO ASSEMBLER STARTUP 06/20/2005 16:55:58 PAGE 4
SYMBOL TABLE LISTING
------ ----- -------
N A M E T Y P E V A L U E ATTRIBUTES
?C_C51STARTUP. . . C SEG 001DH REL=UNIT
?C_START . . . . . C ADDR ----- EXT
?C_STARTUP . . . . C ADDR 0000H A
?STACK . . . . . . I SEG 0001H REL=UNIT
ACC. . . . . . . . D ADDR 00E0H A
B. . . . . . . . . D ADDR 00F0H A
BOOTFLAG . . . . . D ADDR ----- EXT
CLRCOMP. . . . . . C ADDR 000FH R SEG=?C_C51STARTUP
CLRMEM . . . . . . C ADDR 0007H R SEG=?C_C51STARTUP
CLRXDATA . . . . . C ADDR 0017H R SEG=?C_C51STARTUP
DPH. . . . . . . . D ADDR 0083H A
DPL. . . . . . . . D ADDR 0082H A
IBPSTACK . . . . . N NUMB 0000H A
IBPSTACKTOP. . . . N NUMB 0100H A
IDATALEN . . . . . N NUMB 0100H A
IDATALOOP1 . . . . C ADDR 000AH R SEG=?C_C51STARTUP
L1 . . . . . . . . C ADDR 0012H 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
PPAGE_SFR. . . . . D ADDR 00A0H 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 0000H A
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 + -