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

📄 start_ad.lst

📁 磁流变阻尼器控制器的源程序
💻 LST
字号:
A51 MACRO ASSEMBLER  START_AD                                                             04/02/2008 13:06:26 PAGE     1


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

LOC  OBJ            LINE     SOURCE

                       1     $nomod51 
                       2     ;------------------------------------------------------------------------------
                       3     ;  This file is part of the C51 Compiler package
                       4     ;  Startup Code for the Analog Devices ADuC83x and ADuC84x series
                       5     ;  Copyright (c) 2001-2003 Keil Elektronik GmbH and Keil Software, Inc.
                       6     ;  Version 1.02
                       7     ;------------------------------------------------------------------------------
                       8     ;  START_AD.A51:  This code is executed after processor reset.
                       9     ;
                      10     ;  To translate this file use Ax51 with the following invocation:
                      11     ;
                      12     ;     Ax51 STARTUP.A51
                      13     ;
                      14     ;  To link the modified STARTUP.OBJ file to your application use the following
                      15     ;  Lx51 invocation:
                      16     ;
                      17     ;     Lx51 <your object file list>, STARTUP.OBJ <controls>
                      18     ;
                      19     ;------------------------------------------------------------------------------
                      20     ;
                      21     ;  Setup Extended Data RAM
                      22     ;
                      23     ; On-chip XDATA RAM
                      24     ; XRAMEN     Val  Description
                      25     ; ------     ---  -----------
  0000                26     XRAMEN EQU 0; 0 = disable on-chip XDATA RAM and access off-chip XDATA space
                      27     ;           ; 1 = enable on-chip XDATA RAM
                      28     ;
                      29     ; Extended Stack Mode (16-bit Stack Pointer)
                      30     ; EXSP       Val  Description
                      31     ; ----       ---  -----------
  0000                32     EXSP EQU 0  ; 0 = classic 8051 stack pointer (8-bit) addressing IDATA space
                      33     ;           ; 1 = extended 16-bit stack pointer addressing XDATA space
                      34     ; NOTE: The Extended Stack Mode works only with enabled on-chip XDATA RAM!
                      35     ;
                      36     ; CPU Stack Size Definition in Extended Stack Mode:
                      37     ; The following EQU statements defines the stack space available in extended
                      38     ; stack mode (EXSP set to 1) for the application program.  It should be noted
                      39     ; that the stack space must be adjusted according the actual requirements of 
                      40     ; the application.  This STARTUP file allocates the stack in extended stack
                      41     ; mode in XDATA memory beginning at XSTACKSTART.  The extended stack must
                      42     ; be within the on-chip XDATA memory and XSTACKSTART must be not less than
                      43     ; 100H. 
                      44     ;
  0200                45     STACKSIZE   EQU 200H             ; set to 200H Bytes.
  0600                46     XSTACKSTART EQU 800H - STACKSIZE ; 800H is top of on-chip XRAM.
                      47     ;
                      48     ;------------------------------------------------------------------------------
                      49     ;
                      50     ;  User-defined Power-On Initialization of Memory
                      51     ;
                      52     ;  With the following EQU statements the initialization of memory
                      53     ;  at processor reset can be defined:
                      54     ;
                      55     ;               ; the absolute start-address of IDATA memory is always 0
  0080                56     IDATALEN        EQU     80H     ; the length of IDATA memory in bytes.
                      57     ;
  0000                58     XDATASTART      EQU     0H      ; the absolute start-address of XDATA memory
A51 MACRO ASSEMBLER  START_AD                                                             04/02/2008 13:06:26 PAGE     2

  0000                59     XDATALEN        EQU     0H      ; the length of XDATA memory in bytes.
                      60     ;
  0000                61     PDATASTART      EQU     0H      ; the absolute start-address of PDATA memory
  0000                62     PDATALEN        EQU     0H      ; the length of PDATA memory in bytes.
                      63     ;
                      64     ;  Notes:  The IDATA space overlaps physically the DATA and BIT areas of the
                      65     ;          8051 CPU. At minimum the memory space occupied from the C51 
                      66     ;          run-time routines must be set to zero.
                      67     ;------------------------------------------------------------------------------
                      68     ;
                      69     ;  Reentrant Stack Initilization
                      70     ;
                      71     ;  The following EQU statements define the stack pointer for reentrant
                      72     ;  functions and initialized it:
                      73     ;
                      74     ;  Stack Space for reentrant functions in the SMALL model.
  0000                75     IBPSTACK        EQU     0       ; set to 1 if small reentrant is used.
  0100                76     IBPSTACKTOP     EQU     0FFH+1  ; set top of stack to highest location+1.
                      77     ;
                      78     ;  Stack Space for reentrant functions in the LARGE model.      
  0000                79     XBPSTACK        EQU     0       ; set to 1 if large reentrant is used.
  0000                80     XBPSTACKTOP     EQU     0FFFFH+1; set top of stack to highest location+1.
                      81     ;
                      82     ;  Stack Space for reentrant functions in the COMPACT model.    
  0000                83     PBPSTACK        EQU     0       ; set to 1 if compact reentrant is used.
  0000                84     PBPSTACKTOP     EQU     0FFFFH+1; set top of stack to highest location+1.
                      85     ;
                      86     ;------------------------------------------------------------------------------
                      87     ;
                      88     ;  Page Definition for Using the Compact Model with 64 KByte xdata RAM
                      89     ;
                      90     ;  The following EQU statements define the xdata page used for pdata
                      91     ;  variables. The EQU PPAGE must conform with the PPAGE control used
                      92     ;  in the linker invocation.
                      93     ;
  0001                94     PPAGEENABLE     EQU     1       ; set to 1 if pdata object are used.
  0000                95     PPAGE           EQU     0       ; define PPAGE number.
                      96     ;
                      97     ;------------------------------------------------------------------------------
                      98     
                      99     ; Define CPU Symbols
  0081               100     sfr SP     = 0x81;
  00B7               101     sfr SPH    = 0xB7;
  00AF               102     sfr CFG8xx = 0xAF;    ; Chip Configuration SFR
  00A0               103     sfr P2     = 0xA0;
                     104     
                     105     IF (EXSP = 1) AND (XRAMEN = 0)
                               __error__ "Extended Stack Mode requires enabled on-chip XDATA RAM"
                             ENDIF
                     108     
                     109     IF (EXSP = 1) AND (XSTACKSTART < 100H)
                               __error__ "Extended Stack must start in XRAM above address 100H"
                             ENDIF
                     112     
                     113                     NAME    ?C_STARTUP
                     114     
                     115     
                     116     ?C_C51STARTUP   SEGMENT   CODE
                     117     
                     118     IF (EXSP = 1)
                                             XSEG    AT XSTACKSTART
                                             DS      STACKSIZE       ; Stack Space 200H Bytes
                             ELSE
                     122     ?STACK          SEGMENT   IDATA
----                 123                     RSEG    ?STACK
0000                 124                     DS      1
A51 MACRO ASSEMBLER  START_AD                                                             04/02/2008 13:06:26 PAGE     3

                     125     ENDIF
                     126     
                     127                     EXTRN CODE (?C_START)
                     128                     PUBLIC  ?C_STARTUP
                     129     
----                 130                     CSEG    AT      0
0000 020000   F      131     ?C_STARTUP:     LJMP    STARTUP1
                     132     
----                 133                     RSEG    ?C_C51STARTUP
                     134     
0000                 135     STARTUP1:
                     136     
  0000               137     _CFG8xx EQU (EXSP SHL 7) OR (XRAMEN)
                     138     
                     139     IF _CFG8xx
                                             ORL     CFG8xx,#_CFG8xx    ; set extended memory modes
                             ENDIF
                     142     
                     143     IF IDATALEN <> 0
0000 787F            144                     MOV     R0,#IDATALEN - 1
0002 E4              145                     CLR     A
0003 F6              146     IDATALOOP:      MOV     @R0,A
0004 D8FD            147                     DJNZ    R0,IDATALOOP
                     148     ENDIF
                     149     
                     150     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
                     164     
                     165     IF PPAGEENABLE <> 0
0006 75A000          166                     MOV     P2,#PPAGE
                     167     ENDIF
                     168     
                     169     IF PDATALEN <> 0
                                             MOV     R0,#PDATASTART
                                             MOV     R7,#LOW (PDATALEN)
                                             CLR     A
                             PDATALOOP:      MOVX    @R0,A
                                             INC     R0
                                             DJNZ    R7,PDATALOOP
                             ENDIF
                     177     
                     178     IF IBPSTACK <> 0
                             EXTRN DATA (?C_IBP)
                             
                                             MOV     ?C_IBP,#LOW IBPSTACKTOP
                             ENDIF
                     183     
                     184     IF XBPSTACK <> 0
                             EXTRN DATA (?C_XBP)
                             
                                             MOV     ?C_XBP,#HIGH XBPSTACKTOP
                                             MOV     ?C_XBP+1,#LOW XBPSTACKTOP
                             ENDIF
                     190     
A51 MACRO ASSEMBLER  START_AD                                                             04/02/2008 13:06:26 PAGE     4

                     191     IF PBPSTACK <> 0
                             EXTRN DATA (?C_PBP)
                                             MOV     ?C_PBP,#LOW PBPSTACKTOP
                             ENDIF
                     195     
                     196     IF EXSP = 1
                                             MOV     SP,#LOW (XSTACKSTART-1)
                                             MOV     SPH,#HIGH (XSTACKSTART-1)
                             ELSE
0009 758100   F      200                     MOV     SP,#?STACK-1
                     201     ENDIF
                     202     
                     203     ;EXTRN CODE (?B_SWITCH0)
                     204     ;               CALL    ?B_SWITCH0      ; init bank mechanism to code bank 0
000C 020000   F      205                     LJMP    ?C_START
                     206     
                     207                     END
A51 MACRO ASSEMBLER  START_AD                                                             04/02/2008 13:06:26 PAGE     5

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


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

?C_C51STARTUP. . .  C SEG    000FH       REL=UNIT
?C_START . . . . .  C ADDR   -----       EXT
?C_STARTUP . . . .  C ADDR   0000H   A   
?STACK . . . . . .  I SEG    0001H       REL=UNIT
CFG8XX . . . . . .  D ADDR   00AFH   A   
EXSP . . . . . . .  N NUMB   0000H   A   
IBPSTACK . . . . .  N NUMB   0000H   A   
IBPSTACKTOP. . . .  N NUMB   0100H   A   
IDATALEN . . . . .  N NUMB   0080H   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   0000H   A   
PDATASTART . . . .  N NUMB   0000H   A   
PPAGE. . . . . . .  N NUMB   0000H   A   
PPAGEENABLE. . . .  N NUMB   0001H   A   
SP . . . . . . . .  D ADDR   0081H   A   
SPH. . . . . . . .  D ADDR   00B7H   A   
STACKSIZE. . . . .  N NUMB   0200H   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   
XRAMEN . . . . . .  N NUMB   0000H   A   
XSTACKSTART. . . .  N NUMB   0600H   A   
_CFG8XX. . . . . .  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 + -