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

📄 init.lst

📁 一个充电控制器的完整单片机程序
💻 LST
📖 第 1 页 / 共 2 页
字号:
AX51 MACRO ASSEMBLER  INIT                                                                  15/06/03 14:58:33 PAGE     1


MACRO ASSEMBLER AX51 V2.03a
OBJECT MODULE PLACED IN INIT.OBJ
ASSEMBLER INVOKED BY: d:\Keil\C51\BIN\AX51.EXE INIT.A51 SET(SMALL) DEBUG XREF EP

LOC    OBJ             LINE     SOURCE

                          1     $nomod51 
                          2     ;------------------------------------------------------------------------------
                          3     ;  This file is part of the C51 Compiler package
                          4     ;  Copyright (c) 1988-2002 Keil Elektronik GmbH and Keil Software, Inc.
                          5     ;------------------------------------------------------------------------------
                          6     ;  INIT.A51:  This code is executed, if the application program contains
                          7     ;             initialized variables at file level.
                          8     ;
                          9     ;  If you are using uVision2, just add the file as last file to your project.
                         10     ;  *** IMPORTANT NOTE ***:  this file needs to be the last file of the linker 
                         11     ;  input list.  If you are using uVision2 this file should be therefore the 
                         12     ;  last file in your project tree.
                         13     ;
                         14     ;
                         15     ;  To translate this file use Ax51 with the following invocation:
                         16     ;
                         17     ;     Ax51 INIT.A51
                         18     ;
                         19     ;  To link the modified INIT.OBJ file to your application use the following
                         20     ;  linker invocation:
                         21     ;
                         22     ;     Lx51 <your object file list>, INIT.OBJ <controls>
                         23     ;
                         24     ;------------------------------------------------------------------------------
                         25     ;
                         26     ;  User-defined Watch-Dog Refresh.
                         27     ;
                         28     ;  If the C application contains many initialized variables uses a watchdog
                         29     ;  it might be possible that the user has to include a watchdog refresh into
                         30     ;  the initialization process. The watchdog refresh routine can be included
                         31     ;  in the following MACRO and can alter all CPU registers except
                         32     ;  DPTR.
                         33     ;
                         34     WATCHDOG        MACRO
                         35                     CPL    90H.6           ;P1.6 Include any Watchdog refresh code here
                         36                     ENDM
                         37     
                         38     ;
                         39     ;------------------------------------------------------------------------------
                         40     ;
                         41     ;  Far Memory Support
                         42     ;
                         43     ;  If the C application contains variables in the far memory space that are
                         44     ;  initialized, you need to set the following define to 1.
                         45     ;
                         46     ; --- Set XBANK = 1 when far variables should be initialized
                         47     $set  (XBANK = 0)
                         48     ;
                         49     ;------------------------------------------------------------------------------
                         50     ;
                         51     ;  Dallas 390/400/5240 CPU Contigious Mode
                         52     ;
                         53     ;  If you are using the Dallas Contigious Mode you need to set the following 
                         54     ;  define to 1.
                         55     ;
                         56     ; --- Set DS390 = 1 when CPU runs in Dallas Contigious Mode
                         57     $set  (DS390 = 0)
                         58     ;
AX51 MACRO ASSEMBLER  INIT                                                                  15/06/03 14:58:33 PAGE     2

                         59     ;------------------------------------------------------------------------------
                         60     
                         61     ; Standard SFR Symbols
 00E0                    62     ACC     DATA    0E0H
 0082                    63     DPL     DATA    82H
 0083                    64     DPH     DATA    83H
                         65     
                         66                     NAME    ?C_INIT
                         67     
                         68     
------                   69     ?C_C51STARTUP   SEGMENT   CODE
------                   70     ?C_INITSEG      SEGMENT   CODE          ; Segment with Initializing Data
                         71     
                         72     INIT_IorP       MACRO
                         73     IorPData:                               ; If CY=1 PData Values
                         74                     CLR     A
                         75                     MOVC    A,@A+DPTR
                         76                     INC     DPTR
                         77                     MOV     R0,A            ; Start Address
                         78     IorPLoop:       CLR     A
                         79                     MOVC    A,@A+DPTR
                         80                     INC     DPTR
                         81                     JC      PData
                         82                     MOV     @R0,A
                         83                     SJMP    Common
                         84     PData:          MOVX    @R0,A
                         85     Common:         INC     R0
                         86                     DJNZ    R7,IorPLoop
                         87                     JMP    Loop
                         88                     ENDM
                         89     
                         90     
                         91                     EXTRN CODE (MAIN)
                         92                     PUBLIC  ?C_START
                         93     
------                   94                     RSEG    ?C_C51STARTUP
000000 020000     E      95     INITEND:        LJMP    MAIN
                         96     
                         97     $if  (XBANK = 0)
                         98+1                   INIT_IorP
                        114     $endif 
                        115     
000015 E4               116     Bits:           CLR     A
000016 93               117                     MOVC    A,@A+DPTR
000017 A3               118                     INC     DPTR
000018 F8               119                     MOV     R0,A
000019 5407             120                     ANL     A,#007H
00001B 240C             121                     ADD     A,#Table-LoadTab
00001D C8               122                     XCH     A,R0
00001E C3               123                     CLR     C       
00001F 33               124                     RLC     A               ; Bit Condition to Carry
000020 C4               125                     SWAP    A
000021 540F             126                     ANL     A,#00FH
000023 4420             127                     ORL     A,#20H          ; Bit Address
000025 C8               128                     XCH     A,R0            ; convert to Byte Addressen
000026 83               129                     MOVC    A,@A+PC
000027 4004             130     LoadTab:        JC      Setzen
000029 F4               131                     CPL     A
00002A 56               132                     ANL     A,@R0
00002B 8001             133                     SJMP    BitReady
00002D 46               134     Setzen:         ORL     A,@R0
00002E F6               135     BitReady:       MOV     @R0,A
00002F DFE4             136                     DJNZ    R7,Bits
000031 800B             137                     SJMP    Loop
                        138     
000033 01               139     Table:          DB      00000001B
AX51 MACRO ASSEMBLER  INIT                                                                  15/06/03 14:58:33 PAGE     3

000034 02               140                     DB      00000010B
000035 04               141                     DB      00000100B
000036 08               142                     DB      00001000B
000037 10               143                     DB      00010000B
000038 20               144                     DB      00100000B
000039 40               145                     DB      01000000B
00003A 80               146                     DB      10000000B
                        147                     
                        148     
00003B                  149     ?C_START:       
00003B 900000     F     150                     MOV     DPTR,#?C_INITSEG
00003E                  151     Loop:
                        152+1                   WATCHDOG
000040 E4               154                     CLR     A
000041 7E01             155                     MOV     R6,#1
000043 93               156                     MOVC    A,@A+DPTR
000044 60BA             157                     JZ      INITEND
000046 A3               158                     INC     DPTR
000047 FF               159                     MOV     R7,A
000048 543F             160                     ANL     A,#3FH
00004A 30E509           161                     JNB     ACC.5,NOBIG
00004D 541F             162                     ANL     A,#01FH
00004F FE               163                     MOV     R6,A
000050 E4               164                     CLR     A
000051 93               165                     MOVC    A,@A+DPTR
000052 A3               166                     INC     DPTR
000053 6001             167                     JZ      NOBIG
000055 0E               168                     INC     R6
000056 CF               169     NOBIG:          XCH     A,R7
                        170     
                        171     ; ---- Init for far Variables
                        172     $if  (XBANK = 1)
                                EXTRN CODE (?C?CSTPTR)
                                                ANL     A,#0E0H
                                                CJNE    A,#0E0H,NOHDATA
                                ;
                                HPTRINIT:       CLR     A

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -