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

📄 stc93ml.mac

📁 本程序为某企业的税控机固件程序.基于东芝TMP93CS41 16位单片机编写,符合国家标准.该程序已经经过多次长期调试.
💻 MAC
字号:
;=====================================================================
;         Standard startup program for TLCS-900/L [ Sample ]
;                       [TMP93CM40]
;                           Revision: 5.00
;  This program is examples of standard startup program for
;  TMP93CM40.
;  When you use this sample program, you must rewrite to fit your 
;  system. And please confirm that there is no mistake about 
;  generated object code.
;=====================================================================
;     Copyright(C) TOSHIBA CORPORATION 2000  All rights reserved
;=====================================================================
$MAXIMUM
    module   stc93ml_mac

;=====================================================================
; [ Define MCU address ]
;  This part is definition of target MCU's ROM/RAM address.
;  Rewrite this part to fit your system.
;=====================================================================
BaseXSP      equ     0x880    ; Stack area bottom address

;===[ External symbol definition ]====================================
    extern   small    _B2CS        ; Defined in 'io900l.c"
    extern   small    _WDMOD       ; Defined in 'io900l.c'
    extern   small    _WDCR        ; Defined in 'io900l.c'
    extern   large    __DataRAM    ; Defined in 'lnc93.lcf'
    extern   large    __Initial    ; Defined in 'ini93ml.c'

;=====================================================================
; [ Dummy section ]
;  This part is for initialize of f_area and f_data section.
;  Do not rewrite this part.
;=====================================================================
f_area  section  data  large  align=2,2
f_data  section  data  large  align=2,2

;=====================================================================
; [ Startup routine ]
;  This part is start up routine.
;  Rewrite this part to fit your program.
;
;==[ Caution !! ]=====================================================
;  Don't use following instructions before setting XSP.
;   ( CALL  condition, dst )  ,  ( CALR  dst )
;   ( LINK  dst, num )        ,  ( POP   dst )
;   ( POP   SR )              ,  ( PUSH  SR )
;   ( PUSH  src )             ,  ( RET   condition )
;   ( RETD  num )             ,  ( RETI )
;   ( SWI   num )             ,  ( UNLK  dst )
;=====================================================================
f_code  section  code  large   ; Startup routine Section

;===[ Global symbol '__startup' definition ]==========================
    public  __startup          ; Used in 'ini93ml.c'
__startup:

;===[ Disable interrupt ]=============================================
    di        ; For disable interrupt before setting XSP
              ; IFF = 7 ( Set IFF bit0 to bit2 = 111 )

;===[ WAIT control register / WDT disable setting ]===================
;   Rewrite this part to fit your program.
    ldb     (_B2CS),0x8c    ; WAIT control register -> 0 wait
; 'B2CS'  <- 10001100
    ldb     (_WDMOD),0x00   ; [for RTE] WDT disable
; 'WDMOD' <- 00000000
    ldb     (_WDCR),0xb1    ;
; 'WDCR'  <- 10110001

;===[ Setting Stack Pointer ]=========================================
    ld      XSP,BaseXSP    ; For Setting XSP

;===[ RAM CLEAR ]=====================================================
    ld      xde,startof(f_area)
    ld      xbc,sizeof(f_area)
    ld      ix,bc
    srl     1,xbc
    j       z,FAR_AREA_2
    ld      xhl,xde
    ldw     (xde+),0
    sub     xbc,1
    j       z,FAR_AREA_2
    ldirw   (xde+),(xhl+)
    cp      qbc,0
    j       eq,FAR_AREA_2
    ld      wa,qbc
FAR_AREA_3:
    ldirw   (xde+),(xhl+)
    djnz    wa,FAR_AREA_3
FAR_AREA_2:
    bit     0,ix
    j       z,FAR_AREA_1
    ldb     (xde),0
FAR_AREA_1:

;===[ Initialize of f_data section ]==================================
    ld      xde,__DataRAM
    ld      xhl,startof(f_data)
    ld      xbc,sizeof(f_data)
    or      xbc,xbc
    j       z,FAR_DATA_1
    ldirb   (XDE+),(XHL+)
    cp      qbc,0
    j       eq,FAR_DATA_1
    ld      wa,qbc
FAR_DATA_2:
    ldirb   (xde+),(xhl+)
    djnz    wa,FAR_DATA_2
FAR_DATA_1:

;===[ Jump to initial routine ]=======================================
    j       __Initial      ; Defined in 'ini93ml.c'

    end

⌨️ 快捷键说明

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