OpenCores
URL https://opencores.org/ocsvn/rf6809/rf6809/trunk

Subversion Repositories rf6809

[/] [rf6809/] [trunk/] [software/] [boot/] [boot_rom.asm] - Diff between revs 13 and 14

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 13 Rev 14
Line 170... Line 170...
SerTailXmit     EQU     $138
SerTailXmit     EQU     $138
SerRcvXon               EQU     $139
SerRcvXon               EQU     $139
SerRcvXoff      EQU     $140
SerRcvXoff      EQU     $140
SerRcvBuf               EQU     $BFF000 ; 4kB serial recieve buffer
SerRcvBuf               EQU     $BFF000 ; 4kB serial recieve buffer
 
 
 
farflag EQU             $15F
asmbuf  EQU             $160    ; to $17F
asmbuf  EQU             $160    ; to $17F
 
 
QNdx0           EQU             $780
QNdx0           EQU             $780
QNdx1           EQU             QNdx0+2
QNdx1           EQU             QNdx0+2
QNdx2           EQU             QNdx1+2
QNdx2           EQU             QNdx1+2
Line 188... Line 189...
 
 
 
 
CharOutVec      EQU             $800
CharOutVec      EQU             $800
CharInVec       EQU             $804
CharInVec       EQU             $804
CmdPromptJI     EQU     $808
CmdPromptJI     EQU     $808
 
MonErrVec       EQU             $80C
 
 
; Register save area for monitor
; Register save area for monitor
mon_DSAVE       EQU             $900
mon_DSAVE       EQU             $900
mon_XSAVE       EQU             $902
mon_XSAVE       EQU             $902
mon_YSAVE       EQU             $904
mon_YSAVE       EQU             $904
Line 348... Line 350...
        lda             #$AA
        lda             #$AA
        sta             LEDS
        sta             LEDS
        lda             #FIRST_CORE
        lda             #FIRST_CORE
        sta             IOFocusID       ; core #2 has focus
        sta             IOFocusID       ; core #2 has focus
        sta             RunningID
        sta             RunningID
 
        ; Clear IO focus list
 
        ldx             #0
 
st9:
 
        clr             IOFocusList,x
 
        inx
 
        cmpx    #16
 
        blo             st9
 
        lda             #24
 
        sta             IOFocusList+FIRST_CORE
 
 
        lda             #$0CE
        lda             #$0CE
        sta             ScreenColor
        sta             ScreenColor
        sta             CharColor
        sta             CharColor
        bsr             ClearScreen
        bsr             ClearScreen
        ldd             #DisplayChar
        ldd             #DisplayChar
Line 1280... Line 1292...
        lbsr    DisplayString
        lbsr    DisplayString
        ldd             #HelpMsg
        ldd             #HelpMsg
        lbsr    DisplayString
        lbsr    DisplayString
        ldd             #CmdPrompt
        ldd             #CmdPrompt
        std             CmdPromptJI
        std             CmdPromptJI
 
        ldd             #DisplayErr
 
        std             MonErrVec
 
        ldd             #$63FF                  ; default app stack
 
        std             mon_SSAVE
Monitor:
Monitor:
        leas    $6FFF                           ; reset stack pointer
        leas    $6FFF                           ; reset stack pointer
        clrb                                                    ; turn off keyboard echo
        clrb                                                    ; turn off keyboard echo
        lbsr    SetKeyboardEcho
        lbsr    SetKeyboardEcho
        ; Reset IO vectors
        ; Reset IO vectors
Line 1365... Line 1381...
        lbsr    ClearScreen
        lbsr    ClearScreen
        lbsr    HomeCursor
        lbsr    HomeCursor
        bra             Monitor
        bra             Monitor
PromptD:
PromptD:
        cmpb    #'D'
        cmpb    #'D'
        bne             PromptF
        bne             PromptColon
        bsr             MonGetch
        bsr             MonGetch
        cmpb    #'R'
        cmpb    #'R'
        bne             DumpMemory
        bne             DumpMemory
        bra             DumpRegs
        bra             DumpRegs
 
PromptColon:
 
        cmpb    #':'
 
        bne             PromptF
 
        lbra    EditMemory
PromptF:
PromptF:
        cmpb    #'F'
        cmpb    #'F'
        bne             PromptJ
        bne             PromptJ
        bsr             MonGetch
        bsr             MonGetch
        cmpb    #'I'
        cmpb    #'I'
        bne             Monitor
        bne             PromptFL
        bsr             MonGetch
        bsr             MonGetch
        cmpb    #'G'
        cmpb    #'G'
        bne             Monitor
        bne             Monitor
        jmp             $FE0000
        jmp             $FE0000
 
PromptFL:
 
        cmpb    #'L'
 
        bne             Monitor
 
        lbra    DumpIOFocusList
PromptJ:
PromptJ:
        cmpb    #'J'
        cmpb    #'J'
        lbeq    jump_to_code
        lbeq    jump_to_code
PromptR:
PromptR:
        cmpb    #'R'
        cmpb    #'R'
Line 1461... Line 1485...
        ldd             mon_r2+2
        ldd             mon_r2+2
        subd    mon_r1+2
        subd    mon_r1+2
        ldd             mon_r2
        ldd             mon_r2
        sbcb    mon_r1+1
        sbcb    mon_r1+1
        sbca    mon_r1
        sbca    mon_r1
        lbcs    DisplayErr
        lbcc    grng1
 
        jsr             [MonErrVec]
 
        lbra    Monitor
 
grng1:
        rts
        rts
 
 
shl_numwka:
shl_numwka:
        asl             mon_numwka+3
        asl             mon_numwka+3
        rol             mon_numwka+2
        rol             mon_numwka+2
Line 1572... Line 1599...
gtdc3:
gtdc3:
        ldb             #-1
        ldb             #-1
        rts
        rts
 
 
DisplayErr:
DisplayErr:
        ldx             #msgErr
        ldd             #msgErr
        clrd
        lbsr    DisplayString
        bsr             DisplayStringDX
 
        jmp             Monitor
        jmp             Monitor
 
 
DisplayStringDX
DisplayStringDX
        std             Strptr
        std             Strptr
        stx             Strptr+2
        stx             Strptr+2
Line 1590... Line 1616...
 
 
HelpMsg:
HelpMsg:
        fcb             "? = Display help",CR,LF
        fcb             "? = Display help",CR,LF
        fcb     "CLS = clear screen",CR,LF
        fcb     "CLS = clear screen",CR,LF
;       db      "S = Boot from SD Card",CR,LF
;       db      "S = Boot from SD Card",CR,LF
;       db      ": = Edit memory bytes",CR,LF
        fcb     ": = Edit memory bytes",CR,LF
;       db      "L = Load sector",CR,LF
;       db      "L = Load sector",CR,LF
;       db      "W = Write sector",CR,LF
;       db      "W = Write sector",CR,LF
        fcb "DR = Dump registers",CR,LF
        fcb "DR = Dump registers",CR,LF
        fcb     "D = Dump memory",CR,LF
        fcb     "D = Dump memory",CR,LF
;       db      "F = Fill memory",CR,LF
;       db      "F = Fill memory",CR,LF
;       db  "FL = Dump I/O Focus List",CR,LF
        fcb "FL = Dump I/O Focus List",CR,LF
        fcb "FIG = start FIG Forth",CR,LF
        fcb "FIG = start FIG Forth",CR,LF
;       db      "KILL n = kill task #n",CR,LF
;       db      "KILL n = kill task #n",CR,LF
;       db      "B = start tiny basic",CR,LF
;       db      "B = start tiny basic",CR,LF
;       db      "b = start EhBasic 6502",CR,LF
;       db      "b = start EhBasic 6502",CR,LF
        fcb     "J = Jump to code",CR,LF
        fcb     "J = Jump to code",CR,LF
Line 1611... Line 1637...
        fcb     "s = serial output test",CR,LF
        fcb     "s = serial output test",CR,LF
;       db      "T = Dump task list",CR,LF
;       db      "T = Dump task list",CR,LF
;       db      "TO = Dump timeout list",CR,LF
;       db      "TO = Dump timeout list",CR,LF
        fcb     "TI = display date/time",CR,LF
        fcb     "TI = display date/time",CR,LF
;       db      "TEMP = display temperature",CR,LF
;       db      "TEMP = display temperature",CR,LF
 
        fcb     "U = unassemble",CR,LF
;       db      "P = Piano",CR,LF,0
;       db      "P = Piano",CR,LF,0
        fcb             0
        fcb             0
 
 
msgRegHeadings
msgRegHeadings
        fcb     CR,LF,"  D/AB     X      Y      U      S       PC    DP  CCR",CR,LF,0
        fcb     CR,LF,"  D/AB     X      Y      U      S       PC    DP  CCR",CR,LF,0
Line 1629... Line 1656...
 
 
;------------------------------------------------------------------------------
;------------------------------------------------------------------------------
; Dump Memory
; Dump Memory
;
;
; Usage:
; Usage:
;       $D FFFC12 8
;       $D FFFC12 FFFC20
;
;
; Dump formatted to look like:
; Dump formatted to look like:
;               :FFFC12 012 012 012 012 555 666 777 888
;               :FFFC12 012 012 012 012 555 666 777 888
;
;
;------------------------------------------------------------------------------
;------------------------------------------------------------------------------
 
 
DumpMemory:
DumpMemory:
        bsr             GetTwoParams
        bsr             GetRange
        ldy             #0
        ldy             #0
        ldy             mon_r1+2
        ldy             mon_r1+2
dmpm2:
dmpm2:
        lbsr    CRLF
        lbsr    CRLF
        ldb             #':'
        ldb             #':'
Line 1689... Line 1716...
dmpm3:
dmpm3:
        lbsr    CRLF
        lbsr    CRLF
        lbra    Monitor
        lbra    Monitor
 
 
;------------------------------------------------------------------------------
;------------------------------------------------------------------------------
 
; Edit Memory
 
;
 
; Usage:
 
;       $$:FFFC12 8 "Hello World!" 0
 
;
 
; Dump formatted to look like:
 
;               :FFFC12 012 012 012 012 555 666 777 888
 
;
 
;------------------------------------------------------------------------------
 
 
 
EditMemory:
 
        ldu             #8                                              ; set max byte count
 
        lbsr    GetHexNumber    ; get the start address
 
        ldx             mon_numwka+2
 
EditMem2:
 
        lbsr    ignBlanks                       ; skip over blanks
 
        lbsr    GetHexNumber    ; get the byte value
 
        tstb                                                            ; check for valid value
 
        bmi             EditMem1                        ; if invalid, quit
 
        ldb             mon_numwka+3    ; get value
 
        stb             ,x+                                             ; update memory at address
 
        leau    -1,u                                    ; decremeent byte count
 
        cmpu    #0
 
        bne             EditMem2                        ; go back for annother byte
 
EditMem1:
 
        lbsr    MonGetch                        ; see if a string is being entered
 
        cmpb    #'"'
 
        bne             EditMem3                        ; no string, we're done
 
        ldu             #40                                             ; string must be less than 40 chars
 
EditMem4:
 
        lbsr    MonGetch                        ; look for close quote
 
        cmpb    #'"'
 
        bne             EditMem6                        ; end of string?
 
        ldu             #8                                              ; reset the byte count
 
        bra             EditMem2
 
EditMem6:
 
        stb             ,x+                                             ; store the character in memory
 
        leau    -1,u                                    ; decrement byte count
 
        cmpu    #0
 
        bhi             EditMem4                        ; max 40 chars
 
EditMem3:
 
        lbra    Monitor
 
 
 
 
 
;------------------------------------------------------------------------------
; Dump Registers
; Dump Registers
;
;
;       Usage:
;       Usage:
;               $DR
;               $DR
;------------------------------------------------------------------------------
;------------------------------------------------------------------------------
Line 1740... Line 1812...
 
 
jump_to_code:
jump_to_code:
        bsr             GetHexNumber
        bsr             GetHexNumber
        sei
        sei
        lds             mon_SSAVE
        lds             mon_SSAVE
        ldd             #
        ldd             #
        pshs    d
        pshs    d
        ldb             #>jtc_exit
        ldb             #>jtc_exit
        pshs    b
        pshs    b
        ldd             mon_numwka+2
        ldd             mon_numwka+2    ; get the address parameter
        pshs    d
        pshs    d
        ldb             mon_numwka+1
        ldb             mon_numwka+1
        pshs    b
        pshs    b
        ldd             mon_USAVE
        ldd             mon_USAVE
        pshs    d
        pshs    d
Line 1782... Line 1854...
        ; Reset vectors in case they got toasted.
        ; Reset vectors in case they got toasted.
        ldd             #SerialPeekCharDirect
        ldd             #SerialPeekCharDirect
        std             CharInVec
        std             CharInVec
        ldd             #DisplayChar
        ldd             #DisplayChar
        std             CharOutVec
        std             CharOutVec
 
        ldd             DisplayErr
 
        std             MonErrVec
        ; todo set according to coreid
        ; todo set according to coreid
        lbra    DumpRegs                        ; now go do a register dump
        lbra    DumpRegs                        ; now go do a register dump
 
 
;------------------------------------------------------------------------------
;------------------------------------------------------------------------------
;------------------------------------------------------------------------------
;------------------------------------------------------------------------------
 
 
 
DumpIOFocusList:
 
        ldx             #0
 
dfl2:
 
        ldb             IOFocusList,x
 
        cmpb    #24
 
        bne             dfl1
 
        tfr             x,d
 
        lbsr    DispByteAsHex
 
        ldb             #' '
 
        lbsr    OUTCH
 
dfl1:
 
        inx
 
        cmpx    #16
 
        blo             dfl2
 
        lbsr    CRLF
 
        lbra    Monitor
 
 
 
 
 
;------------------------------------------------------------------------------
 
;------------------------------------------------------------------------------
swi3_rout:
swi3_rout:
        sei
        sei
        puls    a
        puls    a
        sta             mon_CCRSAVE
        sta             mon_CCRSAVE
        puls    D,DPR,X,Y,U
        puls    D,DPR,X,Y,U

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.