STARTUP.lst
上传用户:tzjinxin1
上传日期:2022-08-08
资源大小:272k
文件大小:12k
开发平台:

Visual C++

  1. A51 MACRO ASSEMBLER  STARTUP                                                              06/22/2006 11:44:40 PAGE     1
  2. MACRO ASSEMBLER A51 V8.00
  3. OBJECT MODULE PLACED IN .objSTARTUP.obj
  4. ASSEMBLER INVOKED BY: C:KeilC51BINA51.EXE uCosiiSTARTUP.A51 SET(LARGE) DEBUG PRINT(.lstSTARTUP.lst) OBJECT(.obj
  5.                       STARTUP.obj) EP
  6. LOC  OBJ            LINE     SOURCE
  7.                        1     $nomod51 
  8.                        2     ;------------------------------------------------------------------------------
  9.                        3     ;  This file is part of the C51 Compiler package
  10.                        4     ;  Copyright (c) 1988-2002 Keil Elektronik GmbH and Keil Software, Inc.
  11.                        5     ;------------------------------------------------------------------------------
  12.                        6     ;  STARTUP.A51:  This code is executed after processor reset.
  13.                        7     ;
  14.                        8     ;  To translate this file use A51 with the following invocation:
  15.                        9     ;
  16.                       10     ;     A51 STARTUP.A51
  17.                       11     ;
  18.                       12     ;  To link the modified STARTUP.OBJ file to your application use the following
  19.                       13     ;  BL51 invocation:
  20.                       14     ;
  21.                       15     ;     BL51 <your object file list>, STARTUP.OBJ <controls>
  22.                       16     ;
  23.                       17     ;------------------------------------------------------------------------------
  24.                       18     ;
  25.                       19     ;  User-defined Power-On Initialization of Memory
  26.                       20     ;
  27.                       21     ;  With the following EQU statements the initialization of memory
  28.                       22     ;  at processor reset can be defined:
  29.                       23     ;
  30.                       24     ;               ; the absolute start-address of IDATA memory is always 0
  31.   0080                25     IDATALEN        EQU     80H     ; the length of IDATA memory in bytes.
  32.                       26     ;
  33.   0000                27     XDATASTART      EQU     0H      ; the absolute start-address of XDATA memory
  34.   0000                28     XDATALEN        EQU     0H      ; the length of XDATA memory in bytes.
  35.                       29     ;
  36.   0000                30     PDATASTART      EQU     0H      ; the absolute start-address of PDATA memory
  37.   0000                31     PDATALEN        EQU     0H      ; the length of PDATA memory in bytes.
  38.                       32     ;
  39.                       33     ;  Notes:  The IDATA space overlaps physically the DATA and BIT areas of the
  40.                       34     ;          8051 CPU. At minimum the memory space occupied from the C51 
  41.                       35     ;          run-time routines must be set to zero.
  42.                       36     ;------------------------------------------------------------------------------
  43.                       37     ;
  44.                       38     ;  Reentrant Stack Initilization
  45.                       39     ;
  46.                       40     ;  The following EQU statements define the stack pointer for reentrant
  47.                       41     ;  functions and initialized it:
  48.                       42     ;
  49.                       43     ;  Stack Space for reentrant functions in the SMALL model.
  50.   0000                44     IBPSTACK        EQU     0       ; set to 1 if small reentrant is used.
  51.   0100                45     IBPSTACKTOP     EQU     0FFH+1  ; set top of stack to highest location+1.
  52.                       46     ;
  53.                       47     ;  Stack Space for reentrant functions in the LARGE model.      
  54.   0001                48     XBPSTACK        EQU     1       ; set to 1 if large reentrant is used.
  55.   8000                49     XBPSTACKTOP     EQU     07FFFH+1; set top of stack to highest location+1.
  56.                       50     ;
  57.                       51     ;  Stack Space for reentrant functions in the COMPACT model.    
  58.   0000                52     PBPSTACK        EQU     0       ; set to 1 if compact reentrant is used.
  59.   0000                53     PBPSTACKTOP     EQU     0FFFFH+1; set top of stack to highest location+1.
  60.                       54     ;
  61.                       55     ;------------------------------------------------------------------------------
  62.                       56     ;
  63.                       57     ;  Page Definition for Using the Compact Model with 64 KByte xdata RAM
  64. A51 MACRO ASSEMBLER  STARTUP                                                              06/22/2006 11:44:40 PAGE     2
  65.                       58     ;
  66.                       59     ;  The following EQU statements define the xdata page used for pdata
  67.                       60     ;  variables. The EQU PPAGE must conform with the PPAGE control used
  68.                       61     ;  in the linker invocation.
  69.                       62     ;
  70.   0000                63     PPAGEENABLE     EQU     0       ; set to 1 if pdata object are used.
  71.                       64     ;
  72.   0000                65     PPAGE           EQU     0       ; define PPAGE number.
  73.                       66     ;
  74.   00A0                67     PPAGE_SFR       DATA    0A0H    ; SFR that supplies uppermost address byte
  75.                       68     ;               (most 8051 variants use P2 as uppermost address byte)
  76.                       69     ;
  77.                       70     ;------------------------------------------------------------------------------
  78.                       71     
  79.                       72     ; Standard SFR Symbols 
  80.   00E0                73     ACC     DATA    0E0H
  81.   00F0                74     B       DATA    0F0H
  82.   0081                75     SP      DATA    81H
  83.   0082                76     DPL     DATA    82H
  84.   0083                77     DPH     DATA    83H
  85.                       78     
  86.                       79                     NAME    ?C_STARTUP
  87.                       80     
  88.                       81     
  89.                       82     ?C_C51STARTUP   SEGMENT   CODE
  90.                       83     ?STACK          SEGMENT   IDATA
  91.                       84     
  92. ----                  85                     RSEG    ?STACK
  93. 0000                  86                     DS      1
  94.                       87     
  95.                       88                     EXTRN CODE (?C_START)
  96.                       89                     PUBLIC  ?C_STARTUP
  97.                       90     
  98. ----                  91                     CSEG    AT      0
  99. 0000 020000   F       92     ?C_STARTUP:     LJMP    STARTUP1
  100.                       93     
  101. ----                  94                     RSEG    ?C_C51STARTUP
  102.                       95     
  103. 0000                  96     STARTUP1:
  104.                       97     
  105.                       98     IF IDATALEN <> 0
  106. 0000 787F             99                     MOV     R0,#IDATALEN - 1
  107. 0002 E4              100                     CLR     A
  108. 0003 F6              101     IDATALOOP:      MOV     @R0,A
  109. 0004 D8FD            102                     DJNZ    R0,IDATALOOP
  110.                      103     ENDIF
  111.                      104     
  112.                      105     IF XDATALEN <> 0
  113.                                              MOV     DPTR,#XDATASTART
  114.                                              MOV     R7,#LOW (XDATALEN)
  115.                                IF (LOW (XDATALEN)) <> 0
  116.                                              MOV     R6,#(HIGH (XDATALEN)) +1
  117.                                ELSE
  118.                                              MOV     R6,#HIGH (XDATALEN)
  119.                                ENDIF
  120.                                              CLR     A
  121.                              XDATALOOP:      MOVX    @DPTR,A
  122.                                              INC     DPTR
  123.                                              DJNZ    R7,XDATALOOP
  124.                                              DJNZ    R6,XDATALOOP
  125.                              ENDIF
  126.                      119     
  127.                      120     IF PPAGEENABLE <> 0
  128.                                              MOV     PPAGE_SFR,#PPAGE
  129.                              ENDIF
  130.                      123     
  131. A51 MACRO ASSEMBLER  STARTUP                                                              06/22/2006 11:44:40 PAGE     3
  132.                      124     IF PDATALEN <> 0
  133.                                              MOV     R0,#LOW (PDATASTART)
  134.                                              MOV     R7,#LOW (PDATALEN)
  135.                                              CLR     A
  136.                              PDATALOOP:      MOVX    @R0,A
  137.                                              INC     R0
  138.                                              DJNZ    R7,PDATALOOP
  139.                              ENDIF
  140.                      132     
  141.                      133     IF IBPSTACK <> 0
  142.                              EXTRN DATA (?C_IBP)
  143.                              
  144.                                              MOV     ?C_IBP,#LOW IBPSTACKTOP
  145.                              ENDIF
  146.                      138     
  147.                      139     IF XBPSTACK <> 0
  148.                      140     EXTRN DATA (?C_XBP)
  149.                      141     
  150. 0006 750080   F      142                     MOV     ?C_XBP,#HIGH XBPSTACKTOP
  151. 0009 750000   F      143                     MOV     ?C_XBP+1,#LOW XBPSTACKTOP
  152.                      144     ENDIF
  153.                      145     
  154.                      146     IF PBPSTACK <> 0
  155.                              EXTRN DATA (?C_PBP)
  156.                                              MOV     ?C_PBP,#LOW PBPSTACKTOP
  157.                              ENDIF
  158.                      150     
  159. 000C 758100   F      151                     MOV     SP,#?STACK-1
  160.                      152     ; This code is required if you use L51_BANK.A51 with Banking Mode 4
  161.                      153     ; EXTRN CODE (?B_SWITCH0)
  162.                      154     ;               CALL    ?B_SWITCH0      ; init bank mechanism to code bank 0
  163. 000F 020000   F      155                     LJMP    ?C_START
  164.                      156     
  165.                      157                     END
  166. A51 MACRO ASSEMBLER  STARTUP                                                              06/22/2006 11:44:40 PAGE     4
  167. SYMBOL TABLE LISTING
  168. ------ ----- -------
  169. N A M E             T Y P E  V A L U E   ATTRIBUTES
  170. ?C_C51STARTUP. . .  C SEG    0012H       REL=UNIT
  171. ?C_START . . . . .  C ADDR   -----       EXT
  172. ?C_STARTUP . . . .  C ADDR   0000H   A   
  173. ?C_XBP . . . . . .  D ADDR   -----       EXT
  174. ?STACK . . . . . .  I SEG    0001H       REL=UNIT
  175. ACC. . . . . . . .  D ADDR   00E0H   A   
  176. B. . . . . . . . .  D ADDR   00F0H   A   
  177. DPH. . . . . . . .  D ADDR   0083H   A   
  178. DPL. . . . . . . .  D ADDR   0082H   A   
  179. IBPSTACK . . . . .  N NUMB   0000H   A   
  180. IBPSTACKTOP. . . .  N NUMB   0100H   A   
  181. IDATALEN . . . . .  N NUMB   0080H   A   
  182. IDATALOOP. . . . .  C ADDR   0003H   R   SEG=?C_C51STARTUP
  183. PBPSTACK . . . . .  N NUMB   0000H   A   
  184. PBPSTACKTOP. . . .  N NUMB   0000H   A   
  185. PDATALEN . . . . .  N NUMB   0000H   A   
  186. PDATASTART . . . .  N NUMB   0000H   A   
  187. PPAGE. . . . . . .  N NUMB   0000H   A   
  188. PPAGEENABLE. . . .  N NUMB   0000H   A   
  189. PPAGE_SFR. . . . .  D ADDR   00A0H   A   
  190. SP . . . . . . . .  D ADDR   0081H   A   
  191. STARTUP1 . . . . .  C ADDR   0000H   R   SEG=?C_C51STARTUP
  192. XBPSTACK . . . . .  N NUMB   0001H   A   
  193. XBPSTACKTOP. . . .  N NUMB   8000H   A   
  194. XDATALEN . . . . .  N NUMB   0000H   A   
  195. XDATASTART . . . .  N NUMB   0000H   A   
  196. REGISTER BANK(S) USED: 0 
  197. ASSEMBLY COMPLETE.  0 WARNING(S), 0 ERROR(S)