📄 startup.lst
字号:
218 ; This file is part of the C51 Compiler package
219 ; Copyright (c) 1988-2005 Keil Elektronik GmbH and Keil Software, Inc.
220 ; Version 8.01
221 ;
222 ; *** <<< Use Configuration Wizard in Context Menu >>> ***
223 ;------------------------------------------------------------------------------
224 ; STARTUP.A51: This code is executed after processor reset.
225 ;
226 ; To translate this file use A51 with the following invocation:
227 ;
228 ; A51 STARTUP.A51
229 ;
230 ; To link the modified STARTUP.OBJ file to your application use the following
231 ; Lx51 invocation:
232 ;
233 ; Lx51 your object file list, STARTUP.OBJ controls
234 ;
235 ;------------------------------------------------------------------------------
236 ;
237 ; User-defined <h> Power-On Initialization of Memory
238 ;
239 ; With the following EQU statements the initialization of memory
240 ; at processor reset can be defined:
241 ;
242 ; <o> IDATALEN: IDATA memory size <0x0-0x100>
243 ; <i> Note: The absolute start-address of IDATA memory is always 0
244 ; <i> The IDATA space overlaps physically the DATA and BIT areas.
0100 245 IDATALEN EQU 100H
246 ;
247 ; <o> XDATASTART: XDATA memory start address <0x0-0xFFFF>
248 ; <i> The absolute start address of XDATA memory
0000 249 XDATASTART EQU 0
250 ;
251 ; <o> XDATALEN: XDATA memory size <0x0-0xFFFF>
252 ; <i> The length of XDATA memory in bytes.
1000 253 XDATALEN EQU 0x1000
254 ;
255 ; <o> PDATASTART: PDATA memory start address <0x0-0xFFFF>
256 ; <i> The absolute start address of PDATA memory
A51 MACRO ASSEMBLER STARTUP 01/16/2008 21:37:44 PAGE 5
0000 257 PDATASTART EQU 0H
258 ;
259 ; <o> PDATALEN: PDATA memory size <0x0-0xFF>
260 ; <i> The length of PDATA memory in bytes.
0000 261 PDATALEN EQU 0H
262 ;
263 ;</h>
264 ;------------------------------------------------------------------------------
265 ;
266 ;<h> Reentrant Stack Initialization
267 ;
268 ; The following EQU statements define the stack pointer for reentrant
269 ; functions and initialized it:
270 ;
271 ; <h> Stack Space for reentrant functions in the SMALL model.
272 ; <q> IBPSTACK: Enable SMALL model reentrant stack
273 ; <i> Stack space for reentrant functions in the SMALL model.
0000 274 IBPSTACK EQU 0 ; set to 1 if small reentrant is used.
275 ; <o> IBPSTACKTOP: End address of SMALL model stack <0x0-0xFF>
276 ; <i> Set the top of the stack to the highest location.
0100 277 IBPSTACKTOP EQU 0xFF +1 ; default 0FFH+1
278 ; </h>
279 ;
280 ; <h> Stack Space for reentrant functions in the LARGE model.
281 ; <q> XBPSTACK: Enable LARGE model reentrant stack
282 ; <i> Stack space for reentrant functions in the LARGE model.
0001 283 XBPSTACK EQU 1 ; set to 1 if large reentrant is used.
284 ; <o> XBPSTACKTOP: End address of LARGE model stack <0x0-0xFFFF>
285 ; <i> Set the top of the stack to the highest location.
1000 286 XBPSTACKTOP EQU 0x0FFF +1 ; default 0FFFFH+1
287 ; </h>
288 ;
289 ; <h> Stack Space for reentrant functions in the COMPACT model.
290 ; <q> PBPSTACK: Enable COMPACT model reentrant stack
291 ; <i> Stack space for reentrant functions in the COMPACT model.
0000 292 PBPSTACK EQU 0 ; set to 1 if compact reentrant is used.
293 ;
294 ; <o> PBPSTACKTOP: End address of COMPACT model stack <0x0-0xFFFF>
295 ; <i> Set the top of the stack to the highest location.
0100 296 PBPSTACKTOP EQU 0xFF +1 ; default 0FFH+1
297 ; </h>
298 ;</h>
299 ;------------------------------------------------------------------------------
300 ;
301 ; Memory Page for Using the Compact Model with 64 KByte xdata RAM
302 ; <e>Compact Model Page Definition
303 ;
304 ; <i>Define the XDATA page used for PDATA variables.
305 ; <i>PPAGE must conform with the PPAGE set in the linker invocation.
306 ;
307 ; Enable pdata memory page initalization
0000 308 PPAGEENABLE EQU 0 ; set to 1 if pdata object are used.
309 ;
310 ; <o> PPAGE number <0x0-0xFF>
311 ; <i> uppermost 256-byte address of the page used for PDATA variables.
0000 312 PPAGE EQU 0
313 ;
314 ; <o> SFR address which supplies uppermost address byte <0x0-0xFF>
315 ; <i> most 8051 variants use P2 as uppermost address byte
00AF 316 PPAGE_SFR DATA 0xAF
317 ;
318 ; </e>
319 ;------------------------------------------------------------------------------
320
0000 321 START_INIT EQU 0
322
A51 MACRO ASSEMBLER STARTUP 01/16/2008 21:37:44 PAGE 6
323 ; Standard SFR Symbols
324 ;ACC DATA 0E0H
325 ;B DATA 0F0H
326 ;SP DATA 81H
327 ;DPL DATA 82H
328 ;DPH DATA 83H
329
330 NAME ?C_STARTUP
331
332
333 ?C_C51STARTUP SEGMENT CODE
334 ?STACK SEGMENT IDATA
335
---- 336 RSEG ?STACK
0000 337 DS 1
338
339 EXTRN CODE (?C_START)
340 PUBLIC ?C_STARTUP
341
---- 342 CSEG AT 0
0000 020000 F 343 ?C_STARTUP: LJMP STARTUP1
344
---- 345 RSEG ?C_C51STARTUP
346
0000 347 STARTUP1:
348
349 ;Init EMIF
350 ;MOV EMI0CF,#03H
351 ; SOURCE LINE # 281
352 ;MOV EMI0TC,#0FFH
353 ; SOURCE LINE # 285
354 ; MOV EMI0CN,#00H
355 ;MOV REF0CN,#00H
356
357 IF START_INIT<>0
;Call Port_Init
CLR A
MOV P1MDIN,A
; SOURCE LINE # 249
MOV P2MDOUT,A
; SOURCE LINE # 250
MOV P3MDOUT,#02H
; SOURCE LINE # 252
MOV P74OUT,#0FFH
; SOURCE LINE # 255
MOV P4,#0C0H
; SOURCE LINE # 256
MOV P5,#0FFH
; SOURCE LINE # 257
MOV P6,#0FFH
; SOURCE LINE # 258
MOV P7,#0FFH
; SOURCE LINE # 260
ANL TCON,#0FEH
; SOURCE LINE # 263
MOV XBR0,#07H
; SOURCE LINE # 264
MOV XBR1,#04H
; SOURCE LINE # 265
MOV XBR2,#44H
ENDIF
386
387
388 IF IDATALEN <> 0
A51 MACRO ASSEMBLER STARTUP 01/16/2008 21:37:44 PAGE 7
0000 78FF 389 MOV R0,#IDATALEN - 1
0002 E4 390 CLR A
0003 F6 391 IDATALOOP: MOV @R0,A
0004 D8FD 392 DJNZ R0,IDATALOOP
393 ENDIF
394
395 IF XDATALEN <> 0
0006 900000 396 MOV DPTR,#XDATASTART
0009 7F00 397 MOV R7,#LOW (XDATALEN)
398 IF (LOW (XDATALEN)) <> 0
MOV R6,#(HIGH (XDATALEN)) +1
ELSE
000B 7E10 401 MOV R6,#HIGH (XDATALEN)
402 ENDIF
000D E4 403 CLR A
000E F0 404 XDATALOOP: MOVX @DPTR,A
000F A3 405 INC DPTR
0010 DFFC 406 DJNZ R7,XDATALOOP
0012 DEFA 407 DJNZ R6,XDATALOOP
408 ENDIF
409
410 IF PPAGEENABLE <> 0
MOV PPAGE_SFR,#PPAGE
ENDIF
413
414 IF PDATALEN <> 0
MOV R0,#LOW (PDATASTART)
MOV R7,#LOW (PDATALEN)
CLR A
PDATALOOP: MOVX @R0,A
INC R0
DJNZ R7,PDATALOOP
ENDIF
422
423 IF IBPSTACK <> 0
EXTRN DATA (?C_IBP)
MOV ?C_IBP,#LOW IBPSTACKTOP
ENDIF
428
429 IF XBPSTACK <> 0
430 EXTRN DATA (?C_XBP)
431
0014 750010 F 432 MOV ?C_XBP,#HIGH XBPSTACKTOP
0017 750000 F 433 MOV ?C_XBP+1,#LOW XBPSTACKTOP
434 ENDIF
435
436 IF PBPSTACK <> 0
EXTRN DATA (?C_PBP)
MOV ?C_PBP,#LOW PBPSTACKTOP
ENDIF
440
001A 758100 F 441 MOV SP,#?STACK-1
442
443
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -