⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 startup.lst

📁 C51单片机的C语言例程,可实现定时器中断及其时钟功能的源代码
💻 LST
字号:
A51 MACRO ASSEMBLER  STARTUP                                                              04/01/2006 14:08:06 PAGE     1


MACRO ASSEMBLER A51 V7.10
OBJECT MODULE PLACED IN STARTUP.OBJ
ASSEMBLER INVOKED BY: D:\KeilC51\C51\BIN\A51.EXE STARTUP.A51 SET(SMALL) DEBUG EP

LOC  OBJ            LINE     SOURCE

                       1     ;------------------------------------------------------------------------------
                       2     ;  This file is part of the C51 Compiler package
                       3     ;  Copyright 1995-1996 Keil Software, Inc.
                       4     ;------------------------------------------------------------------------------
                       5     ;  STARTUP.A51:  This code is executed after processor reset.
                       6     ;
                       7     ;  To translate this file use A51 with the following invocation:
                       8     ;
                       9     ;     A51 STARTUP.A51
                      10     ;
                      11     ;  To link the modified STARTUP.OBJ file to your application use the following
                      12     ;  L51 invocation:
                      13     ;
                      14     ;     L51 <your object file list>, STARTUP.OBJ <controls>
                      15     ;
                      16     ;------------------------------------------------------------------------------
                      17     ;
                      18     ;  User-defined Power-On Initialization of Memory
                      19     ;
                      20     ;  With the following EQU statements the initialization of memory
                      21     ;  at processor reset can be defined:
                      22     ;
                      23     ;*******************************************************************************
                      24     ;IDATA for this example is 100h (we have a derivative with 256 bytes of DATA)
                      25     ;*******************************************************************************
                      26     ;               ; the absolute start-address of IDATA memory is always 0
  0100                27     IDATALEN        EQU     100H    ; the length of IDATA memory in bytes.
                      28     ;
                      29     ;*******************************************************************************
                      30     ; XDATA for this example is 2000h (we have 8K of external RAM)
                      31     ;*******************************************************************************
  0000                32     XDATASTART      EQU     0H      ; the absolute start-address of XDATA memory
  0000                33     XDATALEN        EQU     0H      ; the length of XDATA memory in bytes.
                      34     ;
  0000                35     PDATASTART      EQU     0H      ; the absolute start-address of PDATA memory
  00FF                36     PDATALEN        EQU     0ffH    ; the length of PDATA memory in bytes.
                      37     ;
                      38     ;  Notes:  The IDATA space overlaps physically the DATA and BIT areas of the
                      39     ;          8051 CPU. At minimum the memory space occupied from the C51 
                      40     ;          run-time routines must be set to zero.
                      41     ;------------------------------------------------------------------------------
                      42     ;
                      43     ;  Reentrant Stack Initilization
                      44     ;
                      45     ;  The following EQU statements define the stack pointer for reentrant
                      46     ;  functions and initialized it:
                      47     ;
                      48     ;  Stack Space for reentrant functions in the SMALL model.
  0000                49     IBPSTACK        EQU     0       ; set to 1 if small reentrant is used.
  0100                50     IBPSTACKTOP     EQU     0FFH+1  ; set top of stack to highest location+1.
                      51     ;
                      52     ;  Stack Space for reentrant functions in the LARGE model.      
  0000                53     XBPSTACK        EQU     0       ; set to 1 if large reentrant is used.
  0000                54     XBPSTACKTOP     EQU     0FFFFH+1; set top of stack to highest location+1.
                      55     ;
                      56     ;  Stack Space for reentrant functions in the COMPACT model.    
  0000                57     PBPSTACK        EQU     0       ; set to 1 if compact reentrant is used.
  0000                58     PBPSTACKTOP     EQU     0FFFFH+1; set top of stack to highest location+1.
A51 MACRO ASSEMBLER  STARTUP                                                              04/01/2006 14:08:06 PAGE     2

                      59     ;
                      60     ;------------------------------------------------------------------------------
                      61     ;
                      62     ;  Page Definition for Using the Compact Model with 64 KByte xdata RAM
                      63     ;
                      64     ;  The following EQU statements define the xdata page used for pdata
                      65     ;  variables. The EQU PPAGE must conform with the PPAGE control used
                      66     ;  in the linker invocation.
                      67     ;
  0001                68     PPAGEENABLE     EQU     1       ; set to 1 if pdata object are used.
  0090                69     PPAGE           EQU     90H     ; define PPAGE number.
                      70     ;
                      71     ;------------------------------------------------------------------------------
                      72     
                      73                     NAME    ?C_STARTUP
                      74     
                      75     
                      76     ?C_C51STARTUP   SEGMENT   CODE
                      77     ?STACK          SEGMENT   IDATA
                      78     
----                  79                     RSEG    ?STACK
0000                  80                     DS      1
                      81     
                      82                     EXTRN CODE (?C_START)
                      83                     PUBLIC  ?C_STARTUP
                      84     
----                  85                     CSEG    AT      0000h
0000 020000   F       86     ?C_STARTUP:     LJMP    STARTUP1
                      87     
----                  88                     RSEG    ?C_C51STARTUP
                      89     
0000                  90     STARTUP1:
                      91     
                      92     IF IDATALEN <> 0
0000 78FF             93                     MOV     R0,#IDATALEN - 1
0002 E4               94                     CLR     A
0003 F6               95     IDATALOOP:      MOV     @R0,A
0004 D8FD             96                     DJNZ    R0,IDATALOOP
                      97     ENDIF
                      98     
                      99     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
                     113     
                     114     IF PPAGEENABLE <> 0
0006 75A090          115                     MOV     P2,#PPAGE
                     116     ENDIF
                     117     
                     118     IF PDATALEN <> 0
0009 7800            119                     MOV     R0,#PDATASTART
000B 7FFF            120                     MOV     R7,#LOW (PDATALEN)
000D E4              121                     CLR     A
000E F2              122     PDATALOOP:      MOVX    @R0,A
000F 08              123                     INC     R0
0010 DFFC            124                     DJNZ    R7,PDATALOOP
A51 MACRO ASSEMBLER  STARTUP                                                              04/01/2006 14:08:06 PAGE     3

                     125     ENDIF
                     126     
                     127     IF IBPSTACK <> 0
                             EXTRN DATA (?C_IBP)
                             
                                             MOV     ?C_IBP,#LOW IBPSTACKTOP
                             ENDIF
                     132     
                     133     IF XBPSTACK <> 0
                             EXTRN DATA (?C_XBP)
                             
                                             MOV     ?C_XBP,#HIGH XBPSTACKTOP
                                             MOV     ?C_XBP+1,#LOW XBPSTACKTOP
                             ENDIF
                     139     
                     140     IF PBPSTACK <> 0
                             EXTRN DATA (?C_PBP)
                                             MOV     ?C_PBP,#LOW PBPSTACKTOP
                             ENDIF
                     144     
0012 758100   F      145                     MOV     SP,#?STACK-1
0015 020000   F      146                     LJMP    ?C_START
                     147     
                     148                     END
A51 MACRO ASSEMBLER  STARTUP                                                              04/01/2006 14:08:06 PAGE     4

SYMBOL TABLE LISTING
------ ----- -------


N A M E             T Y P E  V A L U E   ATTRIBUTES

?C_C51STARTUP. . .  C SEG    0018H       REL=UNIT
?C_START . . . . .  C ADDR   -----       EXT
?C_STARTUP . . . .  C ADDR   0000H   A   
?STACK . . . . . .  I SEG    0001H       REL=UNIT
IBPSTACK . . . . .  N NUMB   0000H   A   
IBPSTACKTOP. . . .  N NUMB   0100H   A   
IDATALEN . . . . .  N NUMB   0100H   A   
IDATALOOP. . . . .  C ADDR   0003H   R   SEG=?C_C51STARTUP
P2 . . . . . . . .  D ADDR   00A0H   A   
PBPSTACK . . . . .  N NUMB   0000H   A   
PBPSTACKTOP. . . .  N NUMB   0000H   A   
PDATALEN . . . . .  N NUMB   00FFH   A   
PDATALOOP. . . . .  C ADDR   000EH   R   SEG=?C_C51STARTUP
PDATASTART . . . .  N NUMB   0000H   A   
PPAGE. . . . . . .  N NUMB   0090H   A   
PPAGEENABLE. . . .  N NUMB   0001H   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 + -