📄 startup.lst
字号:
A51 MACRO ASSEMBLER STARTUP 12/04/2006 10:50:23 PAGE 1
MACRO ASSEMBLER A51 V8.00
OBJECT MODULE PLACED IN STARTUP.OBJ
ASSEMBLER INVOKED BY: C:\Keil\C51\BIN\A51.EXE STARTUP.a51 SET(LARGE) DEBUG 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
0080 25 IDATALEN EQU 80H ; the length of IDATA memory in bytes.
26 ;
0000 27 XDATASTART EQU 0H ; the absolute start-address of XDATA memory
0000 28 XDATALEN EQU 0H ; 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 12/04/2006 10:50:23 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.
0000 64 PPAGE EQU 0 ; define PPAGE number.
65 ;
66 ;------------------------------------------------------------------------------
67
68 ; Standard SFR Symbols required in XBANKING.A51
00E0 69 ACC DATA 0E0H
00F0 70 B DATA 0F0H
0081 71 SP DATA 81H
0082 72 DPL DATA 82H
0083 73 DPH DATA 83H
0090 74 P1 DATA 90H
00B0 75 P3 DATA 0B0H
76
77 NAME ?C_STARTUP
78
79
80 ?C_C51STARTUP SEGMENT CODE
81 ?STACK SEGMENT IDATA
82
---- 83 RSEG ?STACK
0000 84 DS 1
85
86 EXTRN CODE (?C_START)
87 PUBLIC ?C_STARTUP
88
---- 89 CSEG AT 0
0000 020000 F 90 ?C_STARTUP: LJMP STARTUP1
91
---- 92 RSEG ?C_C51STARTUP
93
0000 94 STARTUP1:
0000 C297 95 CLR P1.7
0002 C296 96 CLR P1.6
97 ;CLR P1.5
98 ;CLR P1.4
0004 D2B4 99 SETB P3.4
100
101 IF IDATALEN <> 0
0006 787F 102 MOV R0,#IDATALEN - 1
0008 E4 103 CLR A
0009 F6 104 IDATALOOP: MOV @R0,A
000A D8FD 105 DJNZ R0,IDATALOOP
106 ENDIF
107
108 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
122
123 IF PPAGEENABLE <> 0
MOV P2,#PPAGE
A51 MACRO ASSEMBLER STARTUP 12/04/2006 10:50:23 PAGE 3
ENDIF
126
127 IF PDATALEN <> 0
MOV R0,#PDATASTART
MOV R7,#LOW (PDATALEN)
CLR A
PDATALOOP: MOVX @R0,A
INC R0
DJNZ R7,PDATALOOP
ENDIF
135
136 IF IBPSTACK <> 0
EXTRN DATA (?C_IBP)
MOV ?C_IBP,#LOW IBPSTACKTOP
ENDIF
141
142 IF XBPSTACK <> 0
EXTRN DATA (?C_XBP)
MOV ?C_XBP,#HIGH XBPSTACKTOP
MOV ?C_XBP+1,#LOW XBPSTACKTOP
ENDIF
148
149 IF PBPSTACK <> 0
EXTRN DATA (?C_PBP)
MOV ?C_PBP,#LOW PBPSTACKTOP
ENDIF
153
000C 758100 F 154 MOV SP,#?STACK-1
155 ; This code is required if you use L51_BANK.A51 with Banking Mode 4
000F 020000 F 156 LJMP ?C_START
157
158 END
A51 MACRO ASSEMBLER STARTUP 12/04/2006 10:50:23 PAGE 4
SYMBOL TABLE LISTING
------ ----- -------
N A M E T Y P E V A L U E ATTRIBUTES
?C_C51STARTUP. . . C SEG 0012H 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
DPH. . . . . . . . D ADDR 0083H A
DPL. . . . . . . . D ADDR 0082H A
IBPSTACK . . . . . N NUMB 0000H A
IBPSTACKTOP. . . . N NUMB 0100H A
IDATALEN . . . . . N NUMB 0080H A
IDATALOOP. . . . . C ADDR 0009H R SEG=?C_C51STARTUP
P1 . . . . . . . . D ADDR 0090H A
P3 . . . . . . . . D ADDR 00B0H A
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 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 + -