📄 startup.lst
字号:
A51 MACRO ASSEMBLER STARTUP 02/07/2006 13:40:45 PAGE 1
MACRO ASSEMBLER A51 V7.07
OBJECT MODULE PLACED IN STARTUP.OBJ
ASSEMBLER INVOKED BY: D:\ProgramFiles\Keil\C51\BIN\A51.EXE STARTUP.A51 XR GEN DB EP NOMOD51
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 ;
24 ; ; the absolute start-address of IDATA memory is always 0
0100 25 IDATALEN EQU 100H ; the length of IDATA memory in bytes.
26 ;
0000 27 XDATASTART EQU 0H ; the absolute start-address of XDATA memory
03FF 28 XDATALEN EQU 03FFH ; the length of XDATA memory in bytes.
29 ;
0000 30 PDATASTART EQU 0H ; the absolute start-address of PDATA memory
0000 31 PDATALEN EQU 0H ; the length of PDATA memory in bytes.
32 ;
33 ; Notes: The IDATA space overlaps physically the DATA and BIT areas of the
34 ; 8051 CPU. At minimum the memory space occupied from the C51
35 ; run-time routines must be set to zero.
36 ;------------------------------------------------------------------------------
37 ;
38 ; Reentrant Stack Initilization
39 ;
40 ; The following EQU statements define the stack pointer for reentrant
41 ; functions and initialized it:
42 ;
43 ; Stack Space for reentrant functions in the SMALL model.
0000 44 IBPSTACK EQU 0 ; set to 1 if small reentrant is used.
0100 45 IBPSTACKTOP EQU 0FFH+1 ; set top of stack to highest location+1.
46 ;
47 ; Stack Space for reentrant functions in the LARGE model.
0000 48 XBPSTACK EQU 0 ; set to 1 if large reentrant is used.
0000 49 XBPSTACKTOP EQU 0FFFFH+1; set top of stack to highest location+1.
50 ;
51 ; Stack Space for reentrant functions in the COMPACT model.
0000 52 PBPSTACK EQU 0 ; set to 1 if compact reentrant is used.
0000 53 PBPSTACKTOP EQU 0FFFFH+1; set top of stack to highest location+1.
54 ;
55 ;------------------------------------------------------------------------------
56 ;
57 ; Page Definition for Using the Compact Model with 64 KByte xdata RAM
58 ;
A51 MACRO ASSEMBLER STARTUP 02/07/2006 13:40:45 PAGE 2
59 ; The following EQU statements define the xdata page used for pdata
60 ; variables. The EQU PPAGE must conform with the PPAGE control used
61 ; in the linker invocation.
62 ;
0000 63 PPAGEENABLE EQU 0 ; set to 1 if pdata object are used.
64 ;
0000 65 PPAGE EQU 0 ; define PPAGE number.
66 ;
00A0 67 PPAGE_SFR DATA 0A0H ; SFR that supplies uppermost address byte
68 ; (most 8051 variants use P2 as uppermost address byte)
69 ;
70 ;------------------------------------------------------------------------------
71
72 ; Standard SFR Symbols
00E0 73 ACC DATA 0E0H
00F0 74 B DATA 0F0H
0081 75 SP DATA 81H
0082 76 DPL DATA 82H
0083 77 DPH DATA 83H
00D9 78 PCA0MD DATA 0D9H
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:
0000 53D9BF 98 ANL PCA0MD, #NOT(40h)
99
100 IF IDATALEN <> 0
0003 78FF 101 MOV R0,#IDATALEN - 1
0005 E4 102 CLR A
0006 F6 103 IDATALOOP: MOV @R0,A
0007 D8FD 104 DJNZ R0,IDATALOOP
105 ENDIF
106
107 IF XDATALEN <> 0
0009 900000 108 MOV DPTR,#XDATASTART
000C 7FFF 109 MOV R7,#LOW (XDATALEN)
110 IF (LOW (XDATALEN)) <> 0
000E 7E04 111 MOV R6,#(HIGH (XDATALEN)) +1
112 ELSE
MOV R6,#HIGH (XDATALEN)
ENDIF
0010 E4 115 CLR A
0011 F0 116 XDATALOOP: MOVX @DPTR,A
0012 A3 117 INC DPTR
0013 DFFC 118 DJNZ R7,XDATALOOP
0015 DEFA 119 DJNZ R6,XDATALOOP
120 ENDIF
121
122 IF PPAGEENABLE <> 0
MOV PPAGE_SFR,#PPAGE
ENDIF
A51 MACRO ASSEMBLER STARTUP 02/07/2006 13:40:45 PAGE 3
125
126 IF PDATALEN <> 0
MOV R0,#LOW (PDATASTART)
MOV R7,#LOW (PDATALEN)
CLR A
PDATALOOP: MOVX @R0,A
INC R0
DJNZ R7,PDATALOOP
ENDIF
134
135 IF IBPSTACK <> 0
EXTRN DATA (?C_IBP)
MOV ?C_IBP,#LOW IBPSTACKTOP
ENDIF
140
141 IF XBPSTACK <> 0
EXTRN DATA (?C_XBP)
MOV ?C_XBP,#HIGH XBPSTACKTOP
MOV ?C_XBP+1,#LOW XBPSTACKTOP
ENDIF
147
148 IF PBPSTACK <> 0
EXTRN DATA (?C_PBP)
MOV ?C_PBP,#LOW PBPSTACKTOP
ENDIF
152
0017 758100 F 153 MOV SP,#?STACK-1
154 ; This code is required if you use L51_BANK.A51 with Banking Mode 4
155 ; EXTRN CODE (?B_SWITCH0)
156 ; CALL ?B_SWITCH0 ; init bank mechanism to code bank 0
001A 020000 F 157 LJMP ?C_START
158
159 END
A51 MACRO ASSEMBLER STARTUP 02/07/2006 13:40:45 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 001DH REL=UNIT 83# 95
?C_START . . . . . C ADDR ----- EXT 89# 157
?C_STARTUP . . . . C ADDR 0000H A 80 90 93#
?STACK . . . . . . I SEG 0001H REL=UNIT 84# 86 153
ACC. . . . . . . . D ADDR 00E0H A 73#
B. . . . . . . . . D ADDR 00F0H A 74#
DPH. . . . . . . . D ADDR 0083H A 77#
DPL. . . . . . . . D ADDR 0082H A 76#
IBPSTACK . . . . . N NUMB 0000H A 44# 135
IBPSTACKTOP. . . . N NUMB 0100H A 45#
IDATALEN . . . . . N NUMB 0100H A 25# 100 101
IDATALOOP. . . . . C ADDR 0006H R SEG=?C_C51STARTUP 103# 104
PBPSTACK . . . . . N NUMB 0000H A 52# 148
PBPSTACKTOP. . . . N NUMB 0000H A 53#
PCA0MD . . . . . . D ADDR 00D9H A 78# 98
PDATALEN . . . . . N NUMB 0000H A 31# 126
PDATASTART . . . . N NUMB 0000H A 30#
PPAGE. . . . . . . N NUMB 0000H A 65#
PPAGEENABLE. . . . N NUMB 0000H A 63# 122
PPAGE_SFR. . . . . D ADDR 00A0H A 67#
SP . . . . . . . . D ADDR 0081H A 75# 153
STARTUP1 . . . . . C ADDR 0000H R SEG=?C_C51STARTUP 93 97#
XBPSTACK . . . . . N NUMB 0000H A 48# 141
XBPSTACKTOP. . . . N NUMB 0000H A 49#
XDATALEN . . . . . N NUMB 03FFH A 28# 107 109 110 111
XDATALOOP. . . . . C ADDR 0011H R SEG=?C_C51STARTUP 116# 118 119
XDATASTART . . . . N NUMB 0000H A 27# 108
REGISTER BANK(S) USED: 0
ASSEMBLY COMPLETE. 0 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -