?? slfprgr-qt4.asm
字號:
;*********************************************************************
; HEADER_START
;
; $File Name: slfprgR-qt4.asm$
; Project: Developper's HC08 Bootloader Slave
; Description: QT/QY main bootloader file
; Platform: HC08
; $Version: 6.0.43.0$
; $Date: Feb-22-2006$
; $Last Modified By: r30323$
; Company: Freescale Semiconductor
; Security: General Business
;
; ===================================================================
; Copyright (c): Freescale Semiconductor, 2004, All rights reserved.
;
; ===================================================================
; THIS SOFTWARE IS PROVIDED BY FREESCALE "AS IS" AND ANY
; EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
; PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL FREESCALE OR
; ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
; NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
; HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
; STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
; OF THE POSSIBILITY OF SUCH DAMAGE.
; ===================================================================
;
; HEADER_END
include "reg-qt4.h"
RCS_ENA EQU 0 ; READ COMMAND SUPPORTED?
IFNE RCS_ENA
RCS EQU $80 ; READ COMMAND SUPPORTED
ELSE
RCS EQU 0 ; READ COMMAND unSUPPORTED
ENDIF
VER_NUM EQU 1 ; FC protocol version number
BUSCLOCK EQU 3200000 ; QTQY's BUS clock
SCISPEED EQU 9600
SPEED EQU 10
ERBLK_LEN EQU 64
WRBLK_LEN EQU 32
FLS_END EQU $FCC0 ; this is APL_VECT address (also from PRM file)
INT_VECT EQU $FFDE
FLBPRMASK EQU $C000 ; this is CPU specific FLBPR mask (i.e. bits that are always in the address)
ROMSTART EQU $2800
GETBYTE EQU ROMSTART+0
RDVRRNG EQU ROMSTART+3
ERARNGE EQU ROMSTART+6
PRGRNGE EQU ROMSTART+9
DELNUS EQU ROMSTART+12
RAMSTART EQU $80
CTRLBYT EQU RAMSTART+$08
CPUSPD EQU RAMSTART+$09
LADDR EQU RAMSTART+$0A
DATA EQU RAMSTART+$0C
INV EQU 1 ; symbolic defines
NOINV EQU 0 ; for inversion selection
MEMSTART_QT1 EQU $F800 ; 1.5kB memory size
MEMSTART_QT2 EQU $F800 ; 1.5kB memory size too ;)
MEMSTART_QT4 EQU $EE00 ; 4kB memory size
MEMSTART_QT5 EQU $EE00 ; 4kB memory size too ;)
MEMSTART_QT8 EQU $DE00 ; 8kB memory size
;**************************************************************************
IF PLATFORM = 1 ; TA5RA5
FLS_BEG EQU MEMSTART_QT4 ; specify YOUR memory limit!
TXDPORT EQU PTA ; <<<
TXDPIN EQU 4 ; <<<
SCITXINV EQU NOINV ; (1 if SCI TX is inverted (no drivers))
SCIRXINV EQU SCITXINV ; (1 if SCI RX is inverted (no drivers))
RXDPORT EQU PTA ; <<<
RXDPIN EQU 5 ; <<<
RXDPUEN EQU 1 ; use pull-up feature
IF RXDPUEN = 1
RXDPUE EQU RXDPORT+$0B ; define pull-up enable port
ENDIF
ENDIF
;**************************************************************************
IF PLATFORM = 2 ; TA1RA0
FLS_BEG EQU MEMSTART_QT4 ; specify YOUR memory limit!
TXDPORT EQU PTA ; <<<
TXDPIN EQU 1 ; <<<
SCITXINV EQU NOINV ; (1 if SCI TX is inverted (no drivers))
SCIRXINV EQU SCITXINV ; (1 if SCI RX is inverted (no drivers))
RXDPORT EQU PTA ; <<<
RXDPIN EQU 0 ; <<<
RXDPUEN EQU 1 ; use pull-up feature
IF RXDPUEN = 1
RXDPUE EQU RXDPORT+$0B ; define pull-up enable port
ENDIF
ENDIF
;**************************************************************************
IF PLATFORM = 3 ; TA4RA3
FLS_BEG EQU MEMSTART_QT4 ; specify YOUR memory limit!
TXDPORT EQU PTA ; <<<
TXDPIN EQU 4 ; <<<
SCITXINV EQU NOINV ; (1 if SCI TX is inverted (no drivers))
SCIRXINV EQU SCITXINV ; (1 if SCI RX is inverted (no drivers))
RXDPORT EQU PTA ; <<<
RXDPIN EQU 3 ; <<<
RXDPUEN EQU 1 ; use pull-up feature
IF RXDPUEN = 1
RXDPUE EQU RXDPORT+$0B ; define pull-up enable port
ENDIF
ENDIF
;**************************************************************************
IF PLATFORM = 4 ; TB5RB4
FLS_BEG EQU MEMSTART_QT4 ; specify YOUR memory limit!
TXDPORT EQU PTB ; <<<
TXDPIN EQU 5 ; <<<
SCITXINV EQU NOINV ; (1 if SCI TX is inverted (no drivers))
SCIRXINV EQU SCITXINV ; (1 if SCI RX is inverted (no drivers))
RXDPORT EQU PTB ; <<<
RXDPIN EQU 4 ; <<<
RXDPUEN EQU 1 ; use pull-up feature
IF RXDPUEN = 1
RXDPUE EQU RXDPORT+$0B ; define pull-up enable port
ENDIF
ENDIF
;**************************************************************************
IF PLATFORM = 5 ; TA3RA2
FLS_BEG EQU MEMSTART_QT4 ; specify YOUR memory limit!
TXDPORT EQU PTA ; <<<
TXDPIN EQU 3 ; <<<
SCITXINV EQU NOINV ; (1 if SCI TX is inverted (no drivers))
SCIRXINV EQU SCITXINV ; (1 if SCI RX is inverted (no drivers))
RXDPORT EQU PTA ; <<<
RXDPIN EQU 2 ; <<<
RXDPUEN EQU 1 ; use pull-up feature
IF RXDPUEN = 1
RXDPUE EQU RXDPORT+$0B ; define pull-up enable port
ENDIF
ENDIF
;**************************************************************************
IF PLATFORM = 6 ; TB5RB3
FLS_BEG EQU MEMSTART_QT4 ; specify YOUR memory limit!
TXDPORT EQU PTB ; <<<
TXDPIN EQU 5 ; <<<
SCITXINV EQU NOINV ; (1 if SCI TX is inverted (no drivers))
SCIRXINV EQU SCITXINV ; (1 if SCI RX is inverted (no drivers))
RXDPORT EQU PTB ; <<<
RXDPIN EQU 3 ; <<<
RXDPUEN EQU 1 ; use pull-up feature
IF RXDPUEN = 1
RXDPUE EQU RXDPORT+$0B ; define pull-up enable port
ENDIF
ENDIF
;**************************************************************************
IF PLATFORM = 7 ; TA2RA2
FLS_BEG EQU MEMSTART_QT4 ; specify YOUR memory limit!
TXDPORT EQU PTA ; <<<
TXDPIN EQU 1 ; <<<
SCITXINV EQU NOINV ; (1 if SCI TX is inverted (no drivers))
SCIRXINV EQU SCITXINV ; (1 if SCI RX is inverted (no drivers))
RXDPORT EQU PTA ; <<<
RXDPIN EQU 2 ; <<<
RXDPUEN EQU 1 ; use pull-up feature
IF RXDPUEN = 1
RXDPUE EQU RXDPORT+$0B ; define pull-up enable port
ENDIF
ENDIF
;**************************************************************************
IF PLATFORM = 10 ; TRiA4 (single wire)
FLS_BEG EQU MEMSTART_QT4 ; specify YOUR memory limit!
TXDPORT EQU PTA ; <<<
TXDPIN EQU 4 ; <<<
SCITXINV EQU INV ; (1 if SCI TX is inverted (no drivers))
SCIRXINV EQU SCITXINV ; (1 if SCI RX is inverted (no drivers))
RXDPORT EQU TXDPORT ; <<<SINGLE WIRE
RXDPIN EQU TXDPIN ; <<<SINGLE WIRE
RXDPUEN EQU 0 ; use pull-up feature
IF RXDPUEN = 1
RXDPUE EQU RXDPORT+$0B ; define pull-up enable port
ENDIF
ENDIF
;**************************************************************************
IF PLATFORM = 11 ; TRA0 (single wire)
FLS_BEG EQU MEMSTART_QT4 ; specify YOUR memory limit!
TXDPORT EQU PTA ; <<<
TXDPIN EQU 0 ; <<<
SCITXINV EQU NOINV ; (1 if SCI TX is inverted (no drivers))
SCIRXINV EQU SCITXINV ; (1 if SCI RX is inverted (no drivers))
RXDPORT EQU TXDPORT ; <<<SINGLE WIRE
RXDPIN EQU TXDPIN ; <<<SINGLE WIRE
RXDPUEN EQU 1 ; use pull-up feature
IF RXDPUEN = 1
RXDPUE EQU RXDPORT+$0B ; define pull-up enable port
ENDIF
ENDIF
;**************************************************************************
IF PLATFORM = 12 ; TRiA1 (single wire)
FLS_BEG EQU MEMSTART_QT4 ; specify YOUR memory limit!
TXDPORT EQU PTA ; <<<
TXDPIN EQU 1 ; <<<
SCITXINV EQU INV ; (1 if SCI TX is inverted (no drivers))
SCIRXINV EQU SCITXINV ; (1 if SCI RX is inverted (no drivers))
RXDPORT EQU TXDPORT ; <<<SINGLE WIRE
RXDPIN EQU TXDPIN ; <<<SINGLE WIRE
RXDPUEN EQU 0 ; use pull-up feature
IF RXDPUEN = 1
RXDPUE EQU RXDPORT+$0B ; define pull-up enable port
ENDIF
ENDIF
;**************************************************************************
IF PLATFORM = 13 ; QT5/8 test - TEST ONLY, NOT VERIFIED YET!!
FLS_BEG EQU MEMSTART_QT8 ; specify YOUR memory limit!
TXDPORT EQU PTA ; <<<
TXDPIN EQU 0 ; <<<
SCITXINV EQU NOINV ; (1 if SCI TX is inverted (no drivers))
SCIRXINV EQU SCITXINV ; (1 if SCI RX is inverted (no drivers))
RXDPORT EQU TXDPORT ; <<<SINGLE WIRE
RXDPIN EQU TXDPIN ; <<<SINGLE WIRE
RXDPUEN EQU 0 ; use pull-up feature (will be done different way)
IF RXDPUEN = 1
RXDPUE EQU RXDPORT+$0B ; define pull-up enable port
ENDIF
ENDIF
;**************************************************************************
IF PLATFORM = 14 ; TRiA3 (single wire)
FLS_BEG EQU MEMSTART_QT4 ; specify YOUR memory limit!
TXDPORT EQU PTA ; <<<
TXDPIN EQU 3 ; <<<
SCITXINV EQU INV ; (1 if SCI TX is inverted (no drivers))
SCIRXINV EQU SCITXINV ; (1 if SCI RX is inverted (no drivers))
RXDPORT EQU TXDPORT ; <<<SINGLE WIRE
RXDPIN EQU TXDPIN ; <<<SINGLE WIRE
RXDPUEN EQU 0 ; use pull-up feature (will be done different way)
IF RXDPUEN = 1
RXDPUE EQU RXDPORT+$0B ; define pull-up enable port
ENDIF
ENDIF
;**************************************************************************
IF PLATFORM = 15 ; TRiA5 (single wire)
FLS_BEG EQU MEMSTART_QT4 ; specify YOUR memory limit!
TXDPORT EQU PTA ; <<<
TXDPIN EQU 5 ; <<<
SCITXINV EQU INV ; (1 if SCI TX is inverted (no drivers))
SCIRXINV EQU SCITXINV ; (1 if SCI RX is inverted (no drivers))
RXDPORT EQU TXDPORT ; <<<SINGLE WIRE
RXDPIN EQU TXDPIN ; <<<SINGLE WIRE
RXDPUEN EQU 0 ; use pull-up feature (will be done different way)
IF RXDPUEN = 1
RXDPUE EQU RXDPORT+$0B ; define pull-up enable port
ENDIF
ENDIF
;**************************************************************************
IF PLATFORM = 16 ; TRiA3 (single wire)
FLS_BEG EQU MEMSTART_QT8 ; specify YOUR memory limit!
TXDPORT EQU PTA ; <<<
TXDPIN EQU 3 ; <<<
SCITXINV EQU INV ; (1 if SCI TX is inverted (no drivers))
SCIRXINV EQU SCITXINV ; (1 if SCI RX is inverted (no drivers))
RXDPORT EQU TXDPORT ; <<<SINGLE WIRE
RXDPIN EQU TXDPIN ; <<<SINGLE WIRE
RXDPUEN EQU 0 ; use pull-up feature (will be done different way)
IF RXDPUEN = 1
RXDPUE EQU RXDPORT+$0B ; define pull-up enable port
ENDIF
ENDIF
;**************************************************************************
IF (RXDPORT = TXDPORT) & (RXDPIN = TXDPIN)
SINGLEWIRE EQU 1 ; do use single-wire feature
ELSE
SINGLEWIRE EQU 0 ; do NOT use single-wire feature
ENDIF
;**************************************************************************
TXDDDR EQU TXDPORT+4
RXDDDR EQU RXDPORT+4
SCITXTICK EQU (BUSCLOCK/SCISPEED)
;*******************************************************************************************
XDEF main
XDEF VEC1
XDEF VEC2
XDEF VEC4
XDEF VEC5
XDEF VEC6
XDEF VEC15
XDEF VEC16
XDEF SCIAPIREF
XDEF FLBPR
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -