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

Subversion Repositories rf6809

[/] [rf6809/] [trunk/] [software/] [boot/] [boot_rom.lst] - Rev 9

Go to most recent revision | Compare with Previous | Blame | View Log

0 error(s), 62 warning(s) unlisted in pass 1
                              ; ============================================================================
                              ;        __
                              ;   \\__/ o\    (C) 2013-2022  Robert Finch, Stratford
                              ;    \  __ /    All rights reserved.
                              ;     \/_//     robfinch<remove>@opencores.org
                              ;       ||
                              ;  
                              ;
                              ; This source file is free software: you can redistribute it and/or modify 
                              ; it under the terms of the GNU Lesser General Public License as published 
                              ; by the Free Software Foundation, either version 3 of the License, or     
                              ; (at your option) any later version.                                      
                              ;                                                                          
                              ; This source file is distributed in the hope that it will be useful,      
                              ; but WITHOUT ANY WARRANTY; without even the implied warranty of           
                              ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            
                              ; GNU General Public License for more details.                             
                              ;                                                                          
                              ; You should have received a copy of the GNU General Public License        
                              ; along with this program.  If not, see <http://www.gnu.org/licenses/>.    
                              ;                                                                          
                              ; ============================================================================
                              ;
                              CR      EQU     $0D             ;ASCII equates
                              LF      EQU     $0A
                              TAB     EQU     $09
                              CTRLC   EQU     $03
                              CTRLH   EQU     $08
                              CTRLI   EQU     $09
                              CTRLJ   EQU     $0A
                              CTRLK   EQU     $0B
                              CTRLM   EQU $0D
                              CTRLS   EQU     $13
                              CTRLX   EQU     $18
                              XON             EQU     $11
                              XOFF    EQU     $13
 
                              FIRST_CORE      EQU     1
                              MAX_TASKNO      EQU 63
                              DRAM_BASE       EQU $10000000
 
                              ScreenLocation          EQU             $10
                              ColorCodeLocation       EQU             $14
                              ScreenLocation2         EQU             $18
                              BlkcpySrc                       EQU             $1C
                              BlkcpyDst                       EQU             $20
                              Strptr                          EQU             $24
                              PICptr                          EQU             $28
                              ; Forth Area
                              ; 0x30-0x60
 
                              RunningID                       EQU             $800000
 
                              ; Task control blocks, room for 256 tasks
                              TCB_NxtRdy              EQU             $00     ; next task on ready / timeout list
                              TCB_PrvRdy              EQU             $04     ; previous task on ready / timeout list
                              TCB_NxtTCB              EQU             $08
                              TCB_Timeout             EQU             $0C
                              TCB_Priority    EQU             $10
                              TCB_MSGPTR_D1   EQU             $14
                              TCB_MSGPTR_D2   EQU             $18
                              TCB_hJCB                        EQU             $1C
                              TCB_Status              EQU             $1E
                              TCB_CursorRow   EQU             $20
                              TCB_CursorCol   EQU             $21
                              TCB_hWaitMbx    EQU             $22     ; handle of mailbox task is waiting at
                              TCB_mbq_next    EQU             $24     ; mailbox queue next
                              TCB_mbq_prev    EQU             $28     ; mailbox queue previous
                              TCB_iof_next    EQU             $2C
                              TCB_iof_prev    EQU             $30
                              TCB_SPSave              EQU             $34     ; TCB_SPSave area
                              TCB_mmu_map             EQU             $38
 
                              KeybdHead               EQU             $FFFFFC800
                              KeybdTail               EQU             $FFFFFC900
                              KeybdEcho               EQU             $FFFFFCA00
                              KeybdBad                EQU             $FFFFFCB00
                              KeybdAck                EQU             $FFFFFCC00
                              KeybdLocks              EQU             $FFFFFCD00
                              KeybdBuffer             EQU             $FFFFFC000      ; buffer is 16 chars
 
                              COREID  EQU             $FFFFFFFE0
                              MSCOUNT EQU             $FFFFFFFE4
                              LEDS            EQU             $FFFE60000
                              TEXTSCR         EQU             $FFFE00000
                              TEXTREG         EQU             $FFFE0DF00
                              TEXT_COLS       EQU             0
                              TEXT_ROWS       EQU             1
                              TEXT_CURPOS     EQU             34
                              KEYBD           EQU             $FFFE30400
                              KEYBDCLR        EQU             $FFFE30402
                              PIC                     EQU             $FFFE3F000
                              SPRITE_CTRL             EQU             $FFFE10000
                              SPRITE_EN                       EQU             $3C0
 
                              BIOS_SCREENS    EQU     $17000000       ; $17000000 to $171FFFFF
 
                              ; EhBASIC vars:
                              ;
                              NmiBase         EQU             $DC
                              IrqBase         EQU             $DF
 
                              ; The IO focus list is a doubly linked list formed into a ring.
                              ;
                              IOFocusNdx      EQU             $100
                              IOFocusID               EQU             $100
 
                              ; These variables use direct page access
                              CursorRow       EQU             $110
                              CursorCol       EQU             $111
                              CharColor       EQU             $112
                              ScreenColor     EQU             $113
                              CursorFlash     EQU             $114
                              KeyState1       EQU     $120
                              KeyState2       EQU     $121
                              KeyLED          EQU     $122
                              KeybdID         EQU     $124
 
                              QNdx0           EQU             $780
                              QNdx1           EQU             QNdx0+2
                              QNdx2           EQU             QNdx1+2
                              QNdx3           EQU             QNdx2+2
                              QNdx4           EQU             QNdx3+2
                              FreeTCB         EQU             QNdx4+2
                              TimeoutList     EQU             FreeTCB+2
                              FreeMbx         EQU             RunningTCB + 2
                              nMailbox        EQU             FreeMbx + 2
                              FreeMsg         EQU             nMailbox + 2
                              nMsgBlk         EQU             FreeMsg + 2
 
                              IrqSource       EQU             $79A
 
                              IRQFlag         EQU             $7C6
 
                              CharOutVec      EQU             $800
                              CharInVec       EQU             $804
 
                              ; Register save area for monitor
                              mon_DSAVE       EQU             $900
                              mon_XSAVE       EQU             $902
                              mon_YSAVE       EQU             $904
                              mon_USAVE       EQU             $906
                              mon_SSAVE       EQU             $908
                              mon_PCSAVE      EQU             $90A
                              mon_DPRSAVE     EQU             $90E
                              mon_CCRSAVE     EQU             $90F
 
                              mon_numwka      EQU             $910
                              mon_r1          EQU             $920
                              mon_r2          EQU             $922
 
                              ; The ORG directive must set an address a multiple of 4 in order for the Verilog
                              ; output to work correctly.
 
                                      org             $FFD0AC
 00FFD0AC 012                             nop
 00FFD0AD 012                             nop
 00FFD0AE 012                             nop
                              XBLANK
 00FFD0AF 0C6020                          ldb             #' '
 00FFD0B1 0170028C8                       lbsr    OUTCH
 00FFD0B4 039                             rts
 
                                      org             $FFD0D0
 00FFD0D0 012                             nop
 00FFD0D1 012                             nop
                              CRLF
                              CRLF1:
 00FFD0D2 0C600D                          ldb             #CR
 00FFD0D4 0170028A5                       lbsr    OUTCH
 00FFD0D7 0C600A                          ldb             #LF
 00FFD0D9 0170028A0                       lbsr    OUTCH
 00FFD0DC 039                             rts
 
                                      org             $FFD0F0
 00FFD0F0 012                             nop
 00FFD0F1 020FDF                          bra             CRLF1
 
                                      org             $FFD1DC
                              ONEKEY
 00FFD1DC 06E90F000804                    jmp             [CharInVec]
 
                                      org             $FFD2C0
 00FFD2C0 012                             nop
                              LETTER
 00FFD2C1 0170026B8                       lbsr    OUTCH
 00FFD2C4 039                             rts
 
                                      org             $FFD2CC
 00FFD2CC 012                             nop
 00FFD2CD 012                             nop
                              HEX2
 00FFD2CE 0170020CC                       lbsr    DispByteAsHex
 00FFD2D1 039                             rts
                              HEX4
 00FFD2D2 0170020BF                       lbsr    DispWordAsHex
 00FFD2D5 039                             rts
 
                                      org             $FFD300
                              ClearScreenJmp
 00FFD300 016001ECD                       lbra    ClearScreen
                                      org             $FFD308
                              HomeCursorJmp
 00FFD308 016001F36                       lbra    HomeCursor
 
                                      org             $FFE000
 
                              ; Local RAM test routine
                              ; Checkerboard testing.
                              ; There is 70kB of local RAM
                              ; Does not use any RAM including no stack
 
                              ramtest:
 00FFE000 18E000000                       ldy             #0
 00FFE003 086001                          lda             #1
 00FFE005 0150B7FFFE60000                 sta             LEDS
 00FFE00A 0CCAAA555                       ldd             #$AAA555
                              ramtest1:
 00FFE00D 0EDA01                          std             ,y++
 00FFE00F 18CC00000                       cmpy    #$C00000
 00FFE012 025FF9                          blo             ramtest1
                                      ; now readback values and compare
 00FFE014 18E000000                       ldy             #0
                              ramtest3:
 00FFE017 0ECA01                          ldd             ,y++
 00FFE019 183AAA555                       cmpd    #$AAA555
 00FFE01C 02600E                          bne             ramerr
 00FFE01E 18CC00000                       cmpy    #$C00000
 00FFE021 025FF4                          blo             ramtest3
 00FFE023 086002                          lda             #2
 00FFE025 0150B7FFFE60000                 sta             LEDS
 00FFE02A 06EC04                          jmp             ,u
                              ramerr:
 00FFE02C 086080                          lda             #$80
 00FFE02E 0150B7FFFE60000                 sta             LEDS
 00FFE033 08EE00000                       ldx             #TEXTSCR
 00FFE036 0150F6FFFFFFFE0                 ldb             COREID
 00FFE03B 03A                             abx
 00FFE03C 086046                          lda             #'F'
 00FFE03E 0A7804                          sta             ,x
 00FFE040 013                             sync
 00FFE041 06EC04                          jmp             ,u
 
                                      org             $FFF000
 00FFF000 FFF996                          FDB Monitor
 00FFF002 FFF022                          FDB DumRts      ;       NEXTCMD
 00FFF004 FFF95E                          FDB INCH
 00FFF006 FFF963                          FDB INCHE
 00FFF008 FFF967                          FDB INCHEK
 00FFF00A FFF97C                          FDB OUTCH
 00FFF00C FFF381                          FDB PDATA
 00FFF00E FFF374                          FDB PCRLF
 00FFF010 FFF370                          FDB PSTRNG
 00FFF012 FFF022                          FDB DumRts                      ; LRA
 00FFF014 FFF022                          FDB DumRts
 00FFF016 FFF022                          FDB DumRts
 00FFF018 FFF022                          FDB DumRts
 00FFF01A FFF022                          FDB DumRts                      ; VINIZ
 00FFF01C FFF29B                          FDB DisplayChar ;       VOUTCH
 00FFF01E FFF022                          FDB DumRts                      ; ACINIZ
 00FFF020 FFF022                          FDB DumRts                      ; AOUTCH
 
                              DumRts:
 00FFF022 039                             rts
 
                              ;------------------------------------------------------------------------------
                              ;------------------------------------------------------------------------------
 
                              start:
 00FFF023 086055                          lda             #$55                    ; see if we can at least set LEDs
 00FFF025 0150B7FFFE60000                 sta             LEDS
 00FFF02A 0CEFFF030                       ldu             #st6                    ; U = return address
 00FFF02D 07EFFE000                       jmp             ramtest         ; JMP dont JSR
                              st6:
 00FFF030 1CE003FFF                       lds             #$3FFF          ; boot up stack area
 00FFF033 0150B6FFFFFFFE0                 lda             COREID
 00FFF038 081001                          cmpa    #FIRST_CORE
                              ;       beq             st8
                              ;       sync                                            ; halt cores other than 2
                              st8:
                              ;       bne             skip_init
                              ;       bsr             romToRam
                              ;       ldd             #st7 & $FFFF
                              ;       tfr             d,x
                              ;       jmp             ,x                              ; jump to the BIOS now in local RAM
                              st7:
 00FFF03A 08D11F                          bsr             Delay3s         ; give some time for devices to reset
 00FFF03C 0860AA                          lda             #$AA
 00FFF03E 0150B7FFFE60000                 sta             LEDS
 00FFF043 086002                          lda             #2
 00FFF045 097100                          sta             IOFocusID       ; core #2 has focus
 00FFF047 0B7800000                       sta             RunningID
 00FFF04A 0860CE                          lda             #$0CE
 00FFF04C 097113                          sta             ScreenColor
 00FFF04E 097112                          sta             CharColor
 00FFF050 08D17E                          bsr             ClearScreen
 00FFF052 0CCFFF29B                       ldd             #DisplayChar
 00FFF055 0DD800                          std             CharOutVec
 00FFF057 0CCFFF83B                       ldd             #DBGGetKey
 00FFF05A 0DD804                          std             CharInVec
 00FFF05C 0150F6FFFFFFFE0                 ldb             COREID
 00FFF061 0C1001                          cmpb    #FIRST_CORE
 00FFF063 02700D                          beq             init
 00FFF065 020025                          bra             skip_init
 00FFF067 02008D                          bra             multi_sieve
                              st3:
 00FFF069 0860FF                          lda             #$FF
 00FFF06B 0150B7FFFE60000                 sta             LEDS
 00FFF070 020FF7                          bra             st3
 
                                      ; initialize interrupt controller
                                      ; first, zero out all the vectors
                              init:
 00FFF072 08E000080                       ldx             #128
 00FFF075 086001                          lda             #1                      ; set irq(bit0), clear firq (bit1), disable int (bit 6), clear edge sense(bit 7)
 00FFF077 0C6001                          ldb             #FIRST_CORE                     ; serving core id
                              st1:
 00FFF079 06F809E3F000                    clr             PIC,x           ; cause code
 00FFF07D 0A7809E3F001                    sta             PIC+1,x
 00FFF081 0E7809E3F002                    stb             PIC+2,x
 00FFF085 030004                          leax    4,x
 00FFF087 08C000100                       cmpx    #256
 00FFF08A 025FED                          blo             st1
                              ;       lda             #4                              ; make the timer interrupt edge sensitive
                              ;       sta             PIC+4                   ; reg #4 is the edge sensitivity setting
                              ;       sta             PIC                             ; reg #0 is interrupt enable
 
                              skip_init:
 00FFF08C 01C0EF                          andcc   #$EF                    ; unmask irq
 00FFF08E 086038                          lda             #56
 00FFF090 0150B7FFFE0DF00                 sta             TEXTREG+TEXT_COLS
 00FFF095 08601D                          lda             #29
 00FFF097 0150B7FFFE0DF01                 sta             TEXTREG+TEXT_ROWS
 00FFF09C 08D132                          bsr             ClearScreen
 00FFF09E 08D1A1                          bsr             HomeCursor
 00FFF0A0 086005                          lda             #5
 00FFF0A2 0150B7FFFE60000                 sta             LEDS
 00FFF0A7 0CCFFF0BF                       ldd             #msgStartup
 00FFF0AA 08D2A8                          bsr             DisplayString
 00FFF0AC 08E000000                       ldx             #0
 00FFF0AF 0CC000000                       ldd             #0
 00FFF0B2 0170008D1                       lbsr    ShowSprites
 00FFF0B5 017000708                       lbsr    KeybdInit
 00FFF0B8 0DC124                          ldd             KeybdID
 00FFF0BA 08D2D8                          bsr             DispWordAsHex
 00FFF0BC 07EFFF991                       jmp             MonitorStart
 
                              msgStartup
 00FFF0BF 072066036038030039020           fcb             "rf6809 12-bit System Starting.",CR,LF,0
 00FFF0C6 03103202D062069074020
 00FFF0CD 05307907307406506D020
 00FFF0D4 05307406107207406906E
 00FFF0DB 06702E00D00A000
 
                              ;------------------------------------------------------------------------------
                              ; The checkpoint register must be cleared within 1 second or a NMI interrupt
                              ; will occur. checkpoint should be called with a JSR so that the global ROM
                              ; routine is called.
                              ;
                              ; Modifies:
                              ;               none
                              ;------------------------------------------------------------------------------
 
                              checkpoint:
 00FFF0E0 01507FFFFFFFFE1                 clr             $FFFFFFFE1      ; writing any value will do
 00FFF0E5 039                             rts
 
                              ;------------------------------------------------------------------------------
                              ; Copy the system ROM to local RAM
                              ; Running the code from local RAM is probably an order of magnitude faster
                              ; then running from the global ROM. It also reduces the network traffic to
                              ; run from local RAM.
                              ;
                              ; Modifies:
                              ;               d,x,y
                              ;------------------------------------------------------------------------------
 
                              romToRam:
 00FFF0E6 08EFFC000                       ldx             #$FFC000
 00FFF0E9 18E00C000                       ldy             #$00C000
                              romToRam1:
 00FFF0EC 0EC801                          ldd             ,x++
 00FFF0EE 0EDA01                          std             ,y++
 00FFF0F0 08C000000                       cmpx    #0
 00FFF0F3 026FF7                          bne             romToRam1
 00FFF0F5 039                             rts
 
                              ;------------------------------------------------------------------------------
                              ; Multi-core sieve program.
                              ;------------------------------------------------------------------------------
 
                              ; First fill screen chars with 'P' indicating prime positions
                              ; Each core is responsible for the Nth position where N is the
                              ; core number minus two.
                              ;
                              multi_sieve:
 00FFF0F6 086050                          lda             #'P'                                    ; indicate prime
 00FFF0F8 0150F6FFFFFFFE0                 ldb             COREID                          ; find out which core we are
 00FFF0FD 0C0001                          subb    #FIRST_CORE
 00FFF0FF 08E000000                       ldx             #0                                              ; start at first char of screen
 00FFF102 03A                             abx
                              multi_sieve3:
 00FFF103 0A7809E00000                    sta             TEXTSCR,x                       ; store 'P'
 00FFF107 030008                          leax    8,x                                             ; advance to next position
 00FFF109 08C000FFF                       cmpx    #4095
 00FFF10C 025FF5                          blo             multi_sieve3
 00FFF10E 0BDFFF0E0                       jsr             checkpoint
*** warning 1: Long branch within short branch range could be optimized
 00FFF111 0CB002                          addb    #2                                              ; start sieve at 2 (core id)
 00FFF113 08604E                          lda             #'N'                                    ; flag position value of 'N' for non-prime
                              multi_sieve2:
 00FFF115 08E000000                       ldx             #0
 00FFF118 03A                             abx                                                                     ; skip the first position - might be prime
                              multi_sieve1:
 00FFF119 03A                             abx                                                                     ; increment
 00FFF11A 0A7809E00000                    sta             TEXTSCR,x
 00FFF11E 08C000FFF                       cmpx    #4095
 00FFF121 025FF6                          blo             multi_sieve1
 00FFF123 0BDFFF0E0                       jsr             checkpoint
*** warning 1: Long branch within short branch range could be optimized
 00FFF126 0CB008                          addb    #8                                              ; number of cores working on it
 00FFF128 0C1FF0                          cmpb    #4080
 00FFF12A 025FE9                          blo             multi_sieve2
                              multi_sieve4:                                   ; hang machine
 00FFF12C 013                             sync
 00FFF12D 016000866                       lbra    Monitor
 
                              sieve:
 00FFF130 086050                          lda             #'P'                                    ; indicate prime
 00FFF132 08E000000                       ldx             #0                                              ; start at first char of screen
                              sieve3:
 00FFF135 0A7809E00000                    sta             TEXTSCR,x                       ; store 'P'
 00FFF139 030001                          inx                                                                     ; advance to next position
 00FFF13B 08C000FFF                       cmpx    #4095
 00FFF13E 025FF5                          blo             sieve3
 00FFF140 0C6002                          ldb             #2                                              ; start sieve at 2
 00FFF142 08604E                          lda             #'N'                                    ; flag position value of 'N' for non-prime
                              sieve2:
 00FFF144 08E000000                       ldx             #0
 00FFF147 03A                             abx                                                                     ; skip the first position - might be prime
                              sieve1:
 00FFF148 03A                             abx                                                                     ; increment
 00FFF149 0A7809E00000                    sta             TEXTSCR,x
 00FFF14D 08C000FFF                       cmpx    #4095
 00FFF150 025FC7                          blo             multi_sieve1
 00FFF152 05C                             incb                                                            ; number of cores working on it
 00FFF153 0C1FF0                          cmpb    #4080
 00FFF155 025FED                          blo             sieve2
                              sieve4:                                                         ; hang machine
 00FFF157 013                             sync
 00FFF158 016000836                       lbra    MonitorStart
 
                              ;------------------------------------------------------------------------------
                              ; Three second delay for user convenience and to allow some devices time to
                              ; reset.
                              ;------------------------------------------------------------------------------
 
                              Delay3s:
 00FFF15B 0CC895440                       ldd             #9000000
                              dly3s1:
 00FFF15E 0C10FF                          cmpb    #$FF
 00FFF160 026000                          bne             dly3s2
                              dly3s2:
 00FFF162 0150B7FFFE60000                 sta             LEDS
 00FFF167 083000001                       subd    #1
 00FFF16A 026FF2                          bne             dly3s1
 00FFF16C 039                             rts
 
                              ;------------------------------------------------------------------------------
                              ;------------------------------------------------------------------------------
                              ShiftLeft5:
 00FFF16D 058                             aslb
 00FFF16E 049                             rola
 00FFF16F 058                             aslb
 00FFF170 049                             rola
 00FFF171 058                             aslb
 00FFF172 049                             rola
 00FFF173 058                             aslb
 00FFF174 049                             rola
 00FFF175 058                             aslb
 00FFF176 049                             rola
 00FFF177 039                             rts
 
                              ;------------------------------------------------------------------------------
                              ;------------------------------------------------------------------------------
                              ;
                              CopyVirtualScreenToScreen:
 00FFF178 034076                          pshs    d,x,y,u
 00FFF17A 08D0B4                          bsr             GetScreenLocation
 00FFF17C 01F001                          tfr             d,x
 00FFF17E 18EE00000                       ldy             #TEXTSCR
 00FFF181 0CE00032C                       ldu             #56*29/2
                              cv2s1:
 00FFF184 0EC801                          ldd             ,x++
 00FFF186 0EDA01                          std             ,y++
 00FFF188 0335FF                          leau    -1,u
 00FFF18A 283000000                       cmpu    #0
 00FFF18D 026FF5                          bne             cv2s1
                                      ; reset the cursor position in the text controller
 00FFF18F 0D6110                          ldb             CursorRow
 00FFF191 086038                          lda             #56
 00FFF193 03D                             mul
 00FFF194 01F001                          tfr             d,x
 00FFF196 0D6111                          ldb             CursorCol
 00FFF198 03A                             abx
 00FFF199 0150BFFFFE0DF22                 stx             TEXTREG+TEXT_CURPOS
 00FFF19E 0350F6                          puls    d,x,y,u,pc
 
                              ;------------------------------------------------------------------------------
                              ;------------------------------------------------------------------------------
                              ;
                              CopyScreenToVirtualScreen:
 00FFF1A0 034076                          pshs    d,x,y,u
 00FFF1A2 08D08C                          bsr             GetScreenLocation
 00FFF1A4 01F002                          tfr             d,y
 00FFF1A6 08EE00000                       ldx             #TEXTSCR
 00FFF1A9 0CE00032C                       ldu             #56*29/2
                              cs2v1:
 00FFF1AC 0EC801                          ldd             ,x++
 00FFF1AE 0EDA01                          std             ,y++
 00FFF1B0 0335FF                          leau    -1,u
 00FFF1B2 283000000                       cmpu    #0
 00FFF1B5 026FF5                          bne             cs2v1
 00FFF1B7 0350F6                          puls    d,x,y,u,pc
 
                              ;------------------------------------------------------------------------------
                              ;------------------------------------------------------------------------------
 00FFF1B9 054045058054053043052           fcb             "TEXTSCR "
 00FFF1C0 020
 00FFF1C1 FFF1CB                          fcw             TextOpen
 00FFF1C3 FFF1CC                          fcw             TextClose
 00FFF1C5 FFF1CD                          fcw             TextRead
 00FFF1C7 FFF1CE                          fcw             TextWrite
 00FFF1C9 FFF1CF                          fcw             TextSeek
 
                              TextOpen:
 00FFF1CB 039                             rts
                              TextClose:
 00FFF1CC 039                             rts
                              TextRead:
 00FFF1CD 039                             rts
                              TextWrite:
 00FFF1CE 039                             rts
                              TextSeek:
 00FFF1CF 039                             rts
 
                              ;------------------------------------------------------------------------------
                              ; Clear the screen and the screen color memory
                              ; We clear the screen to give a visual indication that the system
                              ; is working at all.
                              ;
                              ; Modifies:
                              ;               none
                              ;------------------------------------------------------------------------------
 
                              ClearScreen:
 00FFF1D0 034076                          pshs    d,x,y,u
 00FFF1D2 08E000658                       ldx             #56*29
 00FFF1D5 01F013                          tfr             x,u
 00FFF1D7 08D057                          bsr             GetScreenLocation
 00FFF1D9 01F002                          tfr             d,y
 00FFF1DB 0C6020                          ldb             #' '                            ; space char
                              cs1:
 00FFF1DD 0E7A00                          stb             ,y+                                     ; set text to space
 00FFF1DF 0301FF                          leax    -1,x                            ; decrement x
 00FFF1E1 026FFA                          bne             cs1
 00FFF1E3 0150F6FFFFFFFE0                 ldb             COREID                  ; update colors only if we have focus
 00FFF1E8 0D1100                          cmpb    IOFocusID
 00FFF1EA 02000D                          bra             cs3
 00FFF1EC 18EE02000                       ldy             #TEXTSCR+$2000
                              ;       lda             CharColor
 00FFF1EF 0860CE                          lda             #$0CE
 00FFF1F1 01F031                          tfr             u,x                                     ; get back count
                              cs2:
 00FFF1F3 0A7A00                          sta             ,y+
 00FFF1F5 0301FF                          leax    -1,x                            ; decrement x
 00FFF1F7 026FFA                          bne             cs2
                              cs3:
 00FFF1F9 0350F6                          puls    d,x,y,u,pc
 
                              ;------------------------------------------------------------------------------
                              ; Scroll text on the screen upwards
                              ;
                              ; Modifies:
                              ;               none
                              ;------------------------------------------------------------------------------
 
                              ScrollUp:
 00FFF1FB 034076                          pshs    d,x,y,u
 00FFF1FD 18E00032B                       ldy             #(56*29-1)/2    ; y = num chars/2 to move
 00FFF200 08D02E                          bsr             GetScreenLocation
 00FFF202 01F001                          tfr             d,x
 00FFF204 01F003                          tfr             d,u
 00FFF206 030038                          leax    56,x                    ; x = index to source row
                              scrup1:
 00FFF208 0EC801                          ldd             ,x++                    ; move 2 characters
 00FFF20A 0EDC01                          std             ,u++
 00FFF20C 0313FF                          leay    -1,y
 00FFF20E 026FF8                          bne             scrup1
 00FFF210 08601E                          lda             #30
 00FFF212 08D002                          bsr             BlankLine
 00FFF214 0350F6                          puls    d,x,y,u,pc
 
                              ;------------------------------------------------------------------------------
                              ; Blank out a line on the display
                              ;
                              ; Modifies:
                              ;               none
                              ; Parameters:
                              ;       acca = line number to blank
                              ;------------------------------------------------------------------------------
 
                              BlankLine:
 00FFF216 034016                          pshs    d,x
 00FFF218 034002                          pshs    a
 00FFF21A 08D014                          bsr             GetScreenLocation
 00FFF21C 01F001                          tfr             d,x
 00FFF21E 035002                          puls    a
 00FFF220 0C6038                          ldb             #56             ; b = # chars to blank out from video controller
 00FFF222 03D                             mul                                     ; d = screen index (row# * #cols)
 00FFF223 03080B                          leax    d,x
 00FFF225 086020                          lda             #' '
 00FFF227 0C6038                          ldb             #56             ; b = # chars to blank out from video controller
                              blnkln1:
 00FFF229 0A7800                          sta             ,x+
 00FFF22B 05A                             decb
 00FFF22C 026FFB                          bne             blnkln1
 00FFF22E 035096                          puls    d,x,pc
 
                              ;------------------------------------------------------------------------------
                              ; Get the location of the screen memory. The location
                              ; depends on whether or not the task has the output focus.
                              ;
                              ; Modifies:
                              ;               d
                              ; Retuns:
                              ;               d = screen location
                              ;------------------------------------------------------------------------------
 
                              GetScreenLocation:
 00FFF230 0150B6FFFFFFFE0                 lda             COREID                  ; which core are we?
 00FFF235 091100                          cmpa    IOFocusID               ; do we have the IO focus
 00FFF237 026004                          bne             gsl1                            ; no, go pick virtual screen address
 00FFF239 0CCE00000                       ldd             #TEXTSCR                ; yes, we update the real screen
 00FFF23C 039                             rts
                              gsl1:
 00FFF23D 0CC007800                       ldd             #$7800
 00FFF240 039                             rts
 
                              ;------------------------------------------------------------------------------
                              ; HomeCursor
                              ; Set the cursor location to the top left of the screen.
                              ;
                              ; Modifies:
                              ;               none
                              ;------------------------------------------------------------------------------
 
                              HomeCursor:
 00FFF241 034016                          pshs    d,x
 00FFF243 00F110                          clr             CursorRow
 00FFF245 00F111                          clr             CursorCol
 00FFF247 0150F6FFFFFFFE0                 ldb             COREID
 00FFF24C 0D1100                          cmpb    IOFocusID
 00FFF24E 026006                          bne             hc1
 00FFF250 04F                             clra
 00FFF251 0150B7FFFE0DF22                 sta             TEXTREG+TEXT_CURPOS
                              hc1:
 00FFF256 035096                          puls    d,x,pc
 
                              ;------------------------------------------------------------------------------
                              ; Update the cursor position in the text controller based on the
                              ;  CursorRow,CursorCol.
                              ;
                              ; Modifies:
                              ;               none
                              ;------------------------------------------------------------------------------
                              ;
                              UpdateCursorPos:
 00FFF258 034016                          pshs    d,x
 00FFF25A 0150F6FFFFFFFE0                 ldb             COREID                          ; update cursor position in text controller
 00FFF25F 0D1100                          cmpb    IOFocusID                       ; only for the task with the output focus
 00FFF261 026014                          bne             ucp1                                    
 00FFF263 096110                          lda             CursorRow
 00FFF265 08403F                          anda    #$3F                                    ; limit of 63 rows
 00FFF267 0150F6FFFE0DF00                 ldb             TEXTREG+TEXT_COLS
 00FFF26C 03D                             mul
 00FFF26D 01F001                          tfr             d,x
 00FFF26F 0D6111                          ldb             CursorCol
 00FFF271 03A                             abx
 00FFF272 0150BFFFFE0DF22                 stx             TEXTREG+TEXT_CURPOS
                              ucp1:
 00FFF277 035096                          puls    d,x,pc
 
                              ;------------------------------------------------------------------------------
                              ; Calculate screen memory location from CursorRow,CursorCol.
                              ; Also refreshes the cursor location.
                              ;
                              ; Modifies:
                              ;               d
                              ; Returns:
                              ;       d = screen location
                              ;------------------------------------------------------------------------------
                              ;
                              CalcScreenLoc:
 00FFF279 034010                          pshs    x
 00FFF27B 096110                          lda             CursorRow
 00FFF27D 0C6038                          ldb             #56
 00FFF27F 03D                             mul
 00FFF280 01F001                          tfr             d,x
 00FFF282 0D6111                          ldb             CursorCol
 00FFF284 03A                             abx
 00FFF285 0150F6FFFFFFFE0                 ldb             COREID                          ; update cursor position in text controller
 00FFF28A 0D1100                          cmpb    IOFocusID                       ; only for the task with the output focus
 00FFF28C 026005                          bne             csl1                                    
 00FFF28E 0150BFFFFE0DF22                 stx             TEXTREG+TEXT_CURPOS
                              csl1:
 00FFF293 08DF9B                          bsr             GetScreenLocation
 00FFF295 03080B                          leax    d,x
 00FFF297 01F010                          tfr             x,d
 00FFF299 035090                          puls    x,pc
 
                              ;------------------------------------------------------------------------------
                              ; Display a character on the screen.
                              ; If the task doesn't have the I/O focus then the character is written to
                              ; the virtual screen.
                              ;
                              ; Modifies:
                              ;               none
                              ; Parameters:
                              ;       accb = char to display
                              ;------------------------------------------------------------------------------
                              ;
                              DisplayChar:
 00FFF29B 034016                          pshs    d,x
 00FFF29D 0C100D                          cmpb    #CR                                     ; carriage return ?
 00FFF29F 026006                          bne             dccr
 00FFF2A1 00F111                          clr             CursorCol               ; just set cursor column to zero on a CR
 00FFF2A3 08DFB3                          bsr             UpdateCursorPos
                              dcx14:
 00FFF2A5 035096                          puls    d,x,pc
                              dccr:
 00FFF2A7 0C1091                          cmpb    #$91                            ; cursor right ?
 00FFF2A9 02600D                          bne             dcx6
 00FFF2AB 096111                          lda             CursorCol
 00FFF2AD 081038                          cmpa    #56
 00FFF2AF 024003                          bhs             dcx7
 00FFF2B1 04C                             inca
 00FFF2B2 097111                          sta             CursorCol
                              dcx7:
 00FFF2B4 08DFA2                          bsr             UpdateCursorPos
 00FFF2B6 035096                          puls    d,x,pc
                              dcx6:
 00FFF2B8 0C1090                          cmpb    #$90                            ; cursor up ?
 00FFF2BA 026009                          bne             dcx8            
 00FFF2BC 096110                          lda             CursorRow
 00FFF2BE 027FF4                          beq             dcx7
 00FFF2C0 04A                             deca
 00FFF2C1 097110                          sta             CursorRow
 00FFF2C3 020FEF                          bra             dcx7
                              dcx8:
 00FFF2C5 0C1093                          cmpb    #$93                            ; cursor left ?
 00FFF2C7 026009                          bne             dcx9
 00FFF2C9 096111                          lda             CursorCol
 00FFF2CB 027FE7                          beq             dcx7
 00FFF2CD 04A                             deca
 00FFF2CE 097111                          sta             CursorCol
 00FFF2D0 020FE2                          bra             dcx7
                              dcx9:
 00FFF2D2 0C1092                          cmpb    #$92                            ; cursor down ?
 00FFF2D4 02600B                          bne             dcx10
 00FFF2D6 096110                          lda             CursorRow
 00FFF2D8 08101D                          cmpa    #29
 00FFF2DA 027FD8                          beq             dcx7
 00FFF2DC 04C                             inca
 00FFF2DD 097110                          sta             CursorRow
 00FFF2DF 020FD3                          bra             dcx7
                              dcx10:
 00FFF2E1 0C1094                          cmpb    #$94                            ; cursor home ?
 00FFF2E3 02600C                          bne             dcx11
 00FFF2E5 096111                          lda             CursorCol
 00FFF2E7 027004                          beq             dcx12
 00FFF2E9 00F111                          clr             CursorCol
 00FFF2EB 020FC7                          bra             dcx7
                              dcx12:
 00FFF2ED 00F110                          clr             CursorRow
 00FFF2EF 020FC3                          bra             dcx7
                              dcx11:
 00FFF2F1 0C1099                          cmpb    #$99                            ; delete ?
 00FFF2F3 026008                          bne             dcx13
 00FFF2F5 08DF82                          bsr             CalcScreenLoc
 00FFF2F7 01F001                          tfr             d,x
 00FFF2F9 096111                          lda             CursorCol               ; acc = cursor column
 00FFF2FB 02000D                          bra             dcx5
                              dcx13
 00FFF2FD 0C1008                          cmpb    #CTRLH                  ; backspace ?
 00FFF2FF 02601A                          bne             dcx3
 00FFF301 096111                          lda             CursorCol
 00FFF303 02702A                          beq             dcx4
 00FFF305 04A                             deca
 00FFF306 097111                          sta             CursorCol
 00FFF308 08DF6F                          bsr             CalcScreenLoc
                              dcx5:
 00FFF30A 0E6001                          ldb             1,x
 00FFF30C 0E7801                          stb             ,x++
 00FFF30E 04C                             inca
 00FFF30F 081038                          cmpa    #56
 00FFF311 025FF7                          blo             dcx5
 00FFF313 0C6020                          ldb             #' '
 00FFF315 0301FF                          leax    -1,x
 00FFF317 0E7804                          stb             ,x
 00FFF319 03509E                          puls    d,x,dp,pc
                              dcx3:
 00FFF31B 0C100A                          cmpb    #LF                             ; linefeed ?
 00FFF31D 02700E                          beq             dclf
 00FFF31F 034004                          pshs    b
 00FFF321 08DF56                          bsr     CalcScreenLoc
 00FFF323 01F001                          tfr             d,x
 00FFF325 035004                          puls    b
 00FFF327 0E7804                          stb             ,x
                                      ; ToDo character color
                              ;       lda             CharColor
                              ;       sta             $2000,x
 00FFF329 08D006                          bsr             IncCursorPos
 00FFF32B 035096                          puls    d,x,pc
                              dclf:
 00FFF32D 08D011                          bsr             IncCursorRow
                              dcx4:
 00FFF32F 035096                          puls    d,x,pc
 
                              ;------------------------------------------------------------------------------
                              ; Increment the cursor position, scroll the screen if needed.
                              ;
                              ; Modifies:
                              ;               none
                              ;------------------------------------------------------------------------------
 
                              IncCursorPos:
 00FFF331 034016                          pshs    d,x
 00FFF333 096111                          lda             CursorCol
 00FFF335 04C                             inca
 00FFF336 097111                          sta             CursorCol
 00FFF338 081038                          cmpa    #56
 00FFF33A 025014                          blo             icc1
 00FFF33C 00F111                          clr             CursorCol               ; column = 0
 00FFF33E 020002                          bra             icr1
                              IncCursorRow:
 00FFF340 034016                          pshs    d,x
                              icr1:
 00FFF342 096110                          lda             CursorRow
 00FFF344 04C                             inca
 00FFF345 097110                          sta             CursorRow
 00FFF347 08101D                          cmpa    #29
 00FFF349 025005                          blo             icc1
 00FFF34B 04A                             deca                                                    ; backup the cursor row, we are scrolling up
 00FFF34C 097110                          sta             CursorRow
 00FFF34E 08DEAB                          bsr             ScrollUp
                              icc1:
 00FFF350 08DF06                          bsr             UpdateCursorPos
                              icc2:
 00FFF352 035096                          puls    d,x,pc  
 
                              ;------------------------------------------------------------------------------
                              ; Display a string on the screen.
                              ;
                              ; Modifies:
                              ;               none
                              ; Parameters:
                              ;               d = pointer to string
                              ;------------------------------------------------------------------------------
                              ;
                              DisplayString:
 00FFF354 034016                          pshs    d,x
 00FFF356 01F001                          tfr             d,x
                              dspj1B:
 00FFF358 0E6800                          ldb             ,x+                             ; move string char into acc
 00FFF35A 027004                          beq             dsretB          ; is it end of string ?
 00FFF35C 08D61E                          bsr             OUTCH                   ; display character
 00FFF35E 020FF8                          bra             dspj1B
                              dsretB:
 00FFF360 035096                          puls    d,x,pc
 
                              DisplayStringCRLF:
 00FFF362 034006                          pshs    d
 00FFF364 08DFEE                          bsr             DisplayString
 00FFF366 0C600D                          ldb             #CR
 00FFF368 08D612                          bsr             OUTCH
 00FFF36A 0C600A                          ldb             #LF
 00FFF36C 08D60E                          bsr             OUTCH
 00FFF36E 035086                          puls    d,pc
                                      
                              ;
                              ; PRINT CR, LF, STRING
                              ;
                              PSTRNG
 00FFF370 08D002                          BSR             PCRLF
 00FFF372 02000D                          BRA             PDATA
                              PCRLF
 00FFF374 034010                          PSHS    X
 00FFF376 08EFFF388                       LDX             #CRLFST
 00FFF379 08D006                          BSR             PDATA
 00FFF37B 035010                          PULS    X
 00FFF37D 039                             RTS
 
                              PRINT
 00FFF37E 0BDFFF97C                       JSR             OUTCH
                              PDATA
 00FFF381 0E6800                          LDB             ,X+
 00FFF383 0C1004                          CMPB    #$04
 00FFF385 026FF7                          BNE             PRINT
 00FFF387 039                             RTS
 
                              CRLFST
 00FFF388 00D00A004                       fcb     CR,LF,4
 
                              DispDWordAsHex:
 00FFF38B 08D007                          bsr             DispWordAsHex
 00FFF38D 01E001                          exg             d,x
 00FFF38F 08D003                          bsr             DispWordAsHex
 00FFF391 01E001                          exg             d,x
 00FFF393 039                             rts
 
                              DispWordAsHex:
 00FFF394 01E089                          exg             a,b
 00FFF396 08D005                          bsr             DispByteAsHex
 00FFF398 01E089                          exg             a,b
 00FFF39A 08D001                          bsr             DispByteAsHex
 00FFF39C 039                             rts
 
                              DispByteAsHex:
 00FFF39D 034004                    pshs  b
 00FFF39F 054                             lsrb
 00FFF3A0 054                             lsrb
 00FFF3A1 054                             lsrb
 00FFF3A2 054                             lsrb
 00FFF3A3 054                             lsrb
 00FFF3A4 054                             lsrb
 00FFF3A5 054                             lsrb
 00FFF3A6 054                             lsrb
 00FFF3A7 08D00C                          bsr             DispNyb
 00FFF3A9 035004                          puls    b
 00FFF3AB 034004                          pshs    b
 00FFF3AD 054                             lsrb
 00FFF3AE 054                             lsrb
 00FFF3AF 054                             lsrb
 00FFF3B0 054                             lsrb
 00FFF3B1 08D002                          bsr             DispNyb
 00FFF3B3 035004                          puls    b
 
                              DispNyb
 00FFF3B5 034004                          pshs    b
 00FFF3B7 0C400F                          andb    #$0F
 00FFF3B9 0C100A                          cmpb    #10
 00FFF3BB 025006                          blo             DispNyb1
 00FFF3BD 0CB037                          addb    #'A'-10
 00FFF3BF 08D5BB                          bsr             OUTCH
 00FFF3C1 035084                          puls    b,pc
                              DispNyb1
 00FFF3C3 0CB030                          addb    #'0'
 00FFF3C5 08D5B5                          bsr             OUTCH
 00FFF3C7 035084                          puls    b,pc
 
                              ;==============================================================================
                              ; Keyboard I/O
                              ;==============================================================================
 
                                      ;--------------------------------------------------------------------------
                                      ; PS2 scan codes to ascii conversion tables.
                                      ;--------------------------------------------------------------------------
                                      ;
                                      org     (* + 127) & $FFFFFF80
 
                              unshiftedScanCodes:
 00FFF400 02E0A902E0A50A30A10A2           fcb     $2e,$a9,$2e,$a5,$a3,$a1,$a2,$ac
 00FFF407 0AC
 00FFF408 02E0AA0A80A60A4009060           fcb     $2e,$aa,$a8,$a6,$a4,$09,$60,$2e
 00FFF40F 02E
 00FFF410 02E02E02E02E02E071031           fcb     $2e,$2e,$2e,$2e,$2e,$71,$31,$2e
 00FFF417 02E
 00FFF418 02E02E07A073061077032           fcb     $2e,$2e,$7a,$73,$61,$77,$32,$2e
 00FFF41F 02E
 00FFF420 02E063078064065034033           fcb     $2e,$63,$78,$64,$65,$34,$33,$2e
 00FFF427 02E
 00FFF428 02E020076066074072035           fcb     $2e,$20,$76,$66,$74,$72,$35,$2e
 00FFF42F 02E
 00FFF430 02E06E062068067079036           fcb     $2e,$6e,$62,$68,$67,$79,$36,$2e
 00FFF437 02E
 00FFF438 02E02E06D06A075037038           fcb     $2e,$2e,$6d,$6a,$75,$37,$38,$2e
 00FFF43F 02E
 00FFF440 02E02C06B06906F030039           fcb     $2e,$2c,$6b,$69,$6f,$30,$39,$2e
 00FFF447 02E
 00FFF448 02E02E02F06C03B07002D           fcb     $2e,$2e,$2f,$6c,$3b,$70,$2d,$2e
 00FFF44F 02E
 00FFF450 02E02E02702E05B03D02E           fcb     $2e,$2e,$27,$2e,$5b,$3d,$2e,$2e
 00FFF457 02E
 00FFF458 0AD02E00D05D02E05C02E           fcb     $ad,$2e,$0d,$5d,$2e,$5c,$2e,$2e
 00FFF45F 02E
 00FFF460 02E02E02E02E02E02E008           fcb     $2e,$2e,$2e,$2e,$2e,$2e,$08,$2e
 00FFF467 02E
 00FFF468 02E09502E09309402E02E           fcb     $2e,$95,$2e,$93,$94,$2e,$2e,$2e
 00FFF46F 02E
 00FFF470 09807F09202E09109001B           fcb     $98,$7f,$92,$2e,$91,$90,$1b,$af
 00FFF477 0AF
 00FFF478 0AB02E09702E02E0960AE           fcb     $ab,$2e,$97,$2e,$2e,$96,$ae,$2e
 00FFF47F 02E
 
 00FFF480 02E02E02E0A702E02E02E           fcb     $2e,$2e,$2e,$a7,$2e,$2e,$2e,$2e
 00FFF487 02E
 00FFF488 02E02E02E02E02E02E02E           fcb     $2e,$2e,$2e,$2e,$2e,$2e,$2e,$2e
 00FFF48F 02E
 00FFF490 02E02E02E02E02E02E02E           fcb     $2e,$2e,$2e,$2e,$2e,$2e,$2e,$2e
 00FFF497 02E
 00FFF498 02E02E02E02E02E02E02E           fcb     $2e,$2e,$2e,$2e,$2e,$2e,$2e,$2e
 00FFF49F 02E
 00FFF4A0 02E02E02E02E02E02E02E           fcb     $2e,$2e,$2e,$2e,$2e,$2e,$2e,$2e
 00FFF4A7 02E
 00FFF4A8 02E02E02E02E02E02E02E           fcb     $2e,$2e,$2e,$2e,$2e,$2e,$2e,$2e
 00FFF4AF 02E
 00FFF4B0 02E02E02E02E02E02E02E           fcb     $2e,$2e,$2e,$2e,$2e,$2e,$2e,$2e
 00FFF4B7 02E
 00FFF4B8 02E02E02E02E02E02E02E           fcb     $2e,$2e,$2e,$2e,$2e,$2e,$2e,$2e
 00FFF4BF 02E
 00FFF4C0 02E02E02E02E02E02E02E           fcb     $2e,$2e,$2e,$2e,$2e,$2e,$2e,$2e
 00FFF4C7 02E
 00FFF4C8 02E02E02E02E02E02E02E           fcb     $2e,$2e,$2e,$2e,$2e,$2e,$2e,$2e
 00FFF4CF 02E
 00FFF4D0 02E02E02E02E02E02E02E           fcb     $2e,$2e,$2e,$2e,$2e,$2e,$2e,$2e
 00FFF4D7 02E
 00FFF4D8 02E02E02E02E02E02E02E           fcb     $2e,$2e,$2e,$2e,$2e,$2e,$2e,$2e
 00FFF4DF 02E
 00FFF4E0 02E02E02E02E02E02E02E           fcb     $2e,$2e,$2e,$2e,$2e,$2e,$2e,$2e
 00FFF4E7 02E
 00FFF4E8 02E02E02E02E02E02E02E           fcb     $2e,$2e,$2e,$2e,$2e,$2e,$2e,$2e
 00FFF4EF 02E
 00FFF4F0 02E02E02E02E02E02E02E           fcb     $2e,$2e,$2e,$2e,$2e,$2e,$2e,$2e
 00FFF4F7 02E
 00FFF4F8 02E02E0FA02E02E02E02E           fcb     $2e,$2e,$fa,$2e,$2e,$2e,$2e,$2e
 00FFF4FF 02E
 
                              shiftedScanCodes:
 00FFF500 02E02E02E02E02E02E02E           fcb     $2e,$2e,$2e,$2e,$2e,$2e,$2e,$2e
 00FFF507 02E
 00FFF508 02E02E02E02E02E00907E           fcb     $2e,$2e,$2e,$2e,$2e,$09,$7e,$2e
 00FFF50F 02E
 00FFF510 02E02E02E02E02E051021           fcb     $2e,$2e,$2e,$2e,$2e,$51,$21,$2e
 00FFF517 02E
 00FFF518 02E02E05A053041057040           fcb     $2e,$2e,$5a,$53,$41,$57,$40,$2e
 00FFF51F 02E
 00FFF520 02E043058044045024023           fcb     $2e,$43,$58,$44,$45,$24,$23,$2e
 00FFF527 02E
 00FFF528 02E020056046054052025           fcb     $2e,$20,$56,$46,$54,$52,$25,$2e
 00FFF52F 02E
 00FFF530 02E04E04204804705905E           fcb     $2e,$4e,$42,$48,$47,$59,$5e,$2e
 00FFF537 02E
 00FFF538 02E02E04D04A05502602A           fcb     $2e,$2e,$4d,$4a,$55,$26,$2a,$2e
 00FFF53F 02E
 00FFF540 02E03C04B04904F029028           fcb     $2e,$3c,$4b,$49,$4f,$29,$28,$2e
 00FFF547 02E
 00FFF548 02E03E03F04C03A05005F           fcb     $2e,$3e,$3f,$4c,$3a,$50,$5f,$2e
 00FFF54F 02E
 00FFF550 02E02E02202E07B02B02E           fcb     $2e,$2e,$22,$2e,$7b,$2b,$2e,$2e
 00FFF557 02E
 00FFF558 02E02E00D07D02E07C02E           fcb     $2e,$2e,$0d,$7d,$2e,$7c,$2e,$2e
 00FFF55F 02E
 00FFF560 02E02E02E02E02E02E008           fcb     $2e,$2e,$2e,$2e,$2e,$2e,$08,$2e
 00FFF567 02E
 00FFF568 02E02E02E02E02E02E02E           fcb     $2e,$2e,$2e,$2e,$2e,$2e,$2e,$2e
 00FFF56F 02E
 00FFF570 02E07F02E02E02E02E01B           fcb     $2e,$7f,$2e,$2e,$2e,$2e,$1b,$2e
 00FFF577 02E
 00FFF578 02E02E02E02E02E02E02E           fcb     $2e,$2e,$2e,$2e,$2e,$2e,$2e,$2e
 00FFF57F 02E
 
 00FFF580 02E02E02E02E02E02E02E           fcb     $2e,$2e,$2e,$2e,$2e,$2e,$2e,$2e
 00FFF587 02E
 00FFF588 02E02E02E02E02E02E02E           fcb     $2e,$2e,$2e,$2e,$2e,$2e,$2e,$2e
 00FFF58F 02E
 00FFF590 02E02E02E02E02E02E02E           fcb     $2e,$2e,$2e,$2e,$2e,$2e,$2e,$2e
 00FFF597 02E
 00FFF598 02E02E02E02E02E02E02E           fcb     $2e,$2e,$2e,$2e,$2e,$2e,$2e,$2e
 00FFF59F 02E
 00FFF5A0 02E02E02E02E02E02E02E           fcb     $2e,$2e,$2e,$2e,$2e,$2e,$2e,$2e
 00FFF5A7 02E
 00FFF5A8 02E02E02E02E02E02E02E           fcb     $2e,$2e,$2e,$2e,$2e,$2e,$2e,$2e
 00FFF5AF 02E
 00FFF5B0 02E02E02E02E02E02E02E           fcb     $2e,$2e,$2e,$2e,$2e,$2e,$2e,$2e
 00FFF5B7 02E
 00FFF5B8 02E02E02E02E02E02E02E           fcb     $2e,$2e,$2e,$2e,$2e,$2e,$2e,$2e
 00FFF5BF 02E
 00FFF5C0 02E02E02E02E02E02E02E           fcb     $2e,$2e,$2e,$2e,$2e,$2e,$2e,$2e
 00FFF5C7 02E
 00FFF5C8 02E02E02E02E02E02E02E           fcb     $2e,$2e,$2e,$2e,$2e,$2e,$2e,$2e
 00FFF5CF 02E
 00FFF5D0 02E02E02E02E02E02E02E           fcb     $2e,$2e,$2e,$2e,$2e,$2e,$2e,$2e
 00FFF5D7 02E
 00FFF5D8 02E02E02E02E02E02E02E           fcb     $2e,$2e,$2e,$2e,$2e,$2e,$2e,$2e
 00FFF5DF 02E
 00FFF5E0 02E02E02E02E02E02E02E           fcb     $2e,$2e,$2e,$2e,$2e,$2e,$2e,$2e
 00FFF5E7 02E
 00FFF5E8 02E02E02E02E02E02E02E           fcb     $2e,$2e,$2e,$2e,$2e,$2e,$2e,$2e
 00FFF5EF 02E
 00FFF5F0 02E02E02E02E02E02E02E           fcb     $2e,$2e,$2e,$2e,$2e,$2e,$2e,$2e
 00FFF5F7 02E
 00FFF5F8 02E02E02E02E02E02E02E           fcb     $2e,$2e,$2e,$2e,$2e,$2e,$2e,$2e
 00FFF5FF 02E
 
                              ; control
                              keybdControlCodes:
 00FFF600 02E02E02E02E02E02E02E           fcb     $2e,$2e,$2e,$2e,$2e,$2e,$2e,$2e
 00FFF607 02E
 00FFF608 02E02E02E02E02E00907E           fcb     $2e,$2e,$2e,$2e,$2e,$09,$7e,$2e
 00FFF60F 02E
 00FFF610 02E02E02E02E02E011021           fcb     $2e,$2e,$2e,$2e,$2e,$11,$21,$2e
 00FFF617 02E
 00FFF618 02E02E01A013001017040           fcb     $2e,$2e,$1a,$13,$01,$17,$40,$2e
 00FFF61F 02E
 00FFF620 02E003018004005024023           fcb     $2e,$03,$18,$04,$05,$24,$23,$2e
 00FFF627 02E
 00FFF628 02E020016006014012025           fcb     $2e,$20,$16,$06,$14,$12,$25,$2e
 00FFF62F 02E
 00FFF630 02E00E00200800701905E           fcb     $2e,$0e,$02,$08,$07,$19,$5e,$2e
 00FFF637 02E
 00FFF638 02E02E00D00A01502602A           fcb     $2e,$2e,$0d,$0a,$15,$26,$2a,$2e
 00FFF63F 02E
 00FFF640 02E03C00B00900F029028           fcb     $2e,$3c,$0b,$09,$0f,$29,$28,$2e
 00FFF647 02E
 00FFF648 02E03E03F00C03A01005F           fcb     $2e,$3e,$3f,$0c,$3a,$10,$5f,$2e
 00FFF64F 02E
 00FFF650 02E02E02202E07B02B02E           fcb     $2e,$2e,$22,$2e,$7b,$2b,$2e,$2e
 00FFF657 02E
 00FFF658 02E02E00D07D02E07C02E           fcb     $2e,$2e,$0d,$7d,$2e,$7c,$2e,$2e
 00FFF65F 02E
 00FFF660 02E02E02E02E02E02E008           fcb     $2e,$2e,$2e,$2e,$2e,$2e,$08,$2e
 00FFF667 02E
 00FFF668 02E02E02E02E02E02E02E           fcb     $2e,$2e,$2e,$2e,$2e,$2e,$2e,$2e
 00FFF66F 02E
 00FFF670 02E07F02E02E02E02E01B           fcb     $2e,$7f,$2e,$2e,$2e,$2e,$1b,$2e
 00FFF677 02E
 00FFF678 02E02E02E02E02E02E02E           fcb     $2e,$2e,$2e,$2e,$2e,$2e,$2e,$2e
 00FFF67F 02E
 
                              keybdExtendedCodes:
 00FFF680 02E02E02E02E0A30A10A2           fcb     $2e,$2e,$2e,$2e,$a3,$a1,$a2,$2e
 00FFF687 02E
 00FFF688 02E02E02E02E02E02E02E           fcb     $2e,$2e,$2e,$2e,$2e,$2e,$2e,$2e
 00FFF68F 02E
 00FFF690 02E02E02E02E02E02E02E           fcb     $2e,$2e,$2e,$2e,$2e,$2e,$2e,$2e
 00FFF697 02E
 00FFF698 02E02E02E02E02E02E02E           fcb     $2e,$2e,$2e,$2e,$2e,$2e,$2e,$2e
 00FFF69F 02E
 00FFF6A0 02E02E02E02E02E02E02E           fcb     $2e,$2e,$2e,$2e,$2e,$2e,$2e,$2e
 00FFF6A7 02E
 00FFF6A8 02E02E02E02E02E02E02E           fcb     $2e,$2e,$2e,$2e,$2e,$2e,$2e,$2e
 00FFF6AF 02E
 00FFF6B0 02E02E02E02E02E02E02E           fcb     $2e,$2e,$2e,$2e,$2e,$2e,$2e,$2e
 00FFF6B7 02E
 00FFF6B8 02E02E02E02E02E02E02E           fcb     $2e,$2e,$2e,$2e,$2e,$2e,$2e,$2e
 00FFF6BF 02E
 00FFF6C0 02E02E02E02E02E02E02E           fcb     $2e,$2e,$2e,$2e,$2e,$2e,$2e,$2e
 00FFF6C7 02E
 00FFF6C8 02E02E02E02E02E02E02E           fcb     $2e,$2e,$2e,$2e,$2e,$2e,$2e,$2e
 00FFF6CF 02E
 00FFF6D0 02E02E02E02E02E02E02E           fcb     $2e,$2e,$2e,$2e,$2e,$2e,$2e,$2e
 00FFF6D7 02E
 00FFF6D8 02E02E02E02E02E02E02E           fcb     $2e,$2e,$2e,$2e,$2e,$2e,$2e,$2e
 00FFF6DF 02E
 00FFF6E0 02E02E02E02E02E02E02E           fcb     $2e,$2e,$2e,$2e,$2e,$2e,$2e,$2e
 00FFF6E7 02E
 00FFF6E8 02E09502E09309402E02E           fcb     $2e,$95,$2e,$93,$94,$2e,$2e,$2e
 00FFF6EF 02E
 00FFF6F0 09809909202E09109002E           fcb     $98,$99,$92,$2e,$91,$90,$2e,$2e
 00FFF6F7 02E
 00FFF6F8 02E02E09702E02E09602E           fcb     $2e,$2e,$97,$2e,$2e,$96,$2e,$2e
 00FFF6FF 02E
 
                              ; ============================================================================
                              ;        __
                              ;   \\__/ o\    (C) 2013-2022  Robert Finch, Waterloo
                              ;    \  __ /    All rights reserved.
                              ;     \/_//     robfinch<remove>@opencores.org
                              ;       ||
                              ;  
                              ;
                              ;       Keyboard driver routines to interface to a PS2 style keyboard
                              ; Converts the scancode to ascii
                              ;
                              ; This source file is free software: you can redistribute it and/or modify 
                              ; it under the terms of the GNU Lesser General Public License as published 
                              ; by the Free Software Foundation, either version 3 of the License, or     
                              ; (at your option) any later version.                                      
                              ;                                                                          
                              ; This source file is distributed in the hope that it will be useful,      
                              ; but WITHOUT ANY WARRANTY; without even the implied warranty of           
                              ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            
                              ; GNU General Public License for more details.                             
                              ;                                                                          
                              ; You should have received a copy of the GNU General Public License        
                              ; along with this program.  If not, see <http://www.gnu.org/licenses/>.    
                              ;                                                                          
                              ; ============================================================================
                              ;
                              SC_F12  EQU     $07
                              SC_C    EQU             $21
                              SC_T    EQU         $2C
                              SC_Z            EQU     $1A
                              SC_DEL  EQU                     $71     ; extend
                              SC_KEYUP        EQU             $F0     ; should be $f0
                              SC_EXTEND EQU     $E0
                              SC_CTRL EQU                     $14
                              SC_RSHIFT               EQU     $59
                              SC_NUMLOCK      EQU     $77
                              SC_SCROLLLOCK           EQU     $7E
                              SC_CAPSLOCK             EQU             $58
                              SC_ALT  EQU                     $11
 
                              ;#define SC_LSHIFT      EQU             $12
                              ;SC_DEL         EQU             $71             ; extend
                              ;SC_LCTRL       EQU             $58
 
                              SC_TAB  EQU     $0D
 
                              ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                              ; Recieve a byte from the keyboard, used after a command is sent to the
                              ; keyboard in order to wait for a response.
                              ;
                              ; Parameters: none
                              ; Returns: accd = recieved byte ($00 to $FF), -1 on timeout
                              ; Modifies: acc
                              ; Stack Space: 2 words
                              ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
                              KeybdRecvByte:
 00FFF700 034010                          pshs    x
 00FFF702 08E000064                       ldx             #100                                            ; wait up to 1s
                              krb3:
 00FFF705 08D05A                          bsr             KeybdGetStatus  ; wait for response from keyboard
 00FFF707 05D                             tstb
 00FFF708 02B00B                          bmi             krb4                                            ; is input buffer full ? yes, branch
 00FFF70A 08D02D                          bsr             Wait10ms                                ; wait a bit
 00FFF70C 0301FF                          leax    -1,x
 00FFF70E 026FF5                          bne             krb3                                            ; go back and try again
 00FFF710 0CCFFFFFF                       ldd             #-1                                                     ; return -1
 00FFF713 035090                          puls    x,pc
                              krb4:
 00FFF715 08D066                          bsr             KeybdGetScancode
 00FFF717 035090                          puls    x,pc
 
                              ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                              ; Send a byte to the keyboard.
                              ;
                              ; Parameters: accb byte to send
                              ; Returns: none
                              ; Modifies: none
                              ; Stack Space: 0 words
                              ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
                              KeybdSendByte:
 00FFF719 0150F7FFFE30400                 stb             KEYBD
 00FFF71E 039                             rts
 
                              ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                              ; Wait until the keyboard transmit is complete
                              ;
                              ; Parameters: none
                              ; Returns: r1 = 0 if successful, r1 = -1 timeout
                              ; Modifies: r1
                              ; Stack Space: 3 words
                              ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
                              KeybdWaitTx:
 00FFF71F 034010                          pshs    x
 00FFF721 08E000064                       ldx             #100                            ; wait a max of 1s
                              kwt1:
 00FFF724 08D03B                          bsr             KeybdGetStatus
 00FFF726 0C4040                          andb    #$40                            ; check for transmit complete bit; branch if bit set
 00FFF728 02600B                          bne             kwt2
 00FFF72A 08D00D                          bsr             Wait10ms                ; delay a little bit
 00FFF72C 0301FF                          leax    -1,x
 00FFF72E 026FF4                          bne             kwt1                            ; go back and try again
 00FFF730 0CCFFFFFF                       ldd             #-1                                     ; timed out, return -1
 00FFF733 035090                          puls    x,pc
                              kwt2:
 00FFF735 04F                             clra                                                    ; wait complete, return 0
 00FFF736 05F                             clrb                                                    
 00FFF737 035090                          puls    x,pc                            
 
                              ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                              ; Wait for 10 ms
                              ;
                              ; Parameters: none
                              ; Returns: none
                              ; Modifies: none
                              ; Stack Space: 2 words
                              ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
                              Wait10ms:
 00FFF739 034006                          pshs    d
 00FFF73B 0150B6FFFFFFFE7                 lda             MSCOUNT+3
                              W10_0001:
 00FFF740 01F089                          tfr             a,b
 00FFF742 0150F0FFFFFFFE7                 subb    MSCOUNT+3
 00FFF747 0C1FFA                          cmpb    #$FFA
 00FFF749 022FF5                          bhi             W10_0001
 00FFF74B 035086                          puls    d,pc
 
                              ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                              ; Wait for 300 ms (256 ms)
                              ;
                              ; Parameters: none
                              ; Returns: none
                              ; Modifies: none
                              ; Stack Space: 2 words
                              ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
                              Wait300ms:
 00FFF74D 034006                          pshs    d
 00FFF74F 0150B6FFFFFFFE7                 lda             MSCOUNT+3
                              W300_0001:
 00FFF754 01F089                          tfr             a,b
 00FFF756 0150F0FFFFFFFE7                 subb    MSCOUNT+3
 00FFF75B 0C1F00                          cmpb    #$F00
 00FFF75D 022FF5                          bhi     W300_0001
 00FFF75F 035086                          puls    d,pc
 
                              ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                              ; Get the keyboard status
                              ;
                              ; Parameters: none
                              ; Returns: d = status
                              ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
                              KeybdGetStatus:
                              kbgs3:
 00FFF761 0150F6FFFE30401                 ldb             KEYBD+1
 00FFF766 0C5080                          bitb    #$80
 00FFF768 02600E                          bne             kbgs1
 00FFF76A 0C5001                          bitb    #$01            ; check parity error flag
 00FFF76C 026002                          bne             kbgs2
 00FFF76E 04F                             clra
 00FFF76F 039                             rts
                              kbgs2:
 00FFF770 0C60FE                          ldb             #$FE            ; request resend
 00FFF772 08DFA5                          bsr             KeybdSendByte
 00FFF774 08DFA9                          bsr             KeybdWaitTx
 00FFF776 020FE9                          bra             kbgs3
                              kbgs1:                                  ; return negative status
 00FFF778 0CAF00                          orb             #$F00
 00FFF77A 086FFF                          lda             #-1
 00FFF77C 039                             rts
 
                              ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                              ; Get the scancode from the keyboard port
                              ;
                              ; Parameters: none
                              ; Returns: acca = scancode
                              ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
                              KeybdGetScancode:
 00FFF77D 04F                             clra
 00FFF77E 0150F6FFFE30400                 ldb             KEYBD                           ; get the scan code
 00FFF783 01507FFFFE30401                 clr             KEYBD+1                 ; clear receive register (write $00 to status reg)
                                      ; The following useful during debug.
                              ;       lbsr    DispByteAsHex
                              ;       pshs    b
                              ;       ldb             #' '
                              ;       lbsr    OUTCH
                              ;       puls    b
 00FFF788 039                             rts
 
                              ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                              ; Set the LEDs on the keyboard.
                              ;
                              ; Parameters: d LED status to set
                              ; Returns: none
                              ; Modifies: none
                              ; Stack Space: 2 words
                              ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
                              KeybdSetLED:
 00FFF789 034004                          pshs    b
 00FFF78B 0C60ED                          ldb             #$ED                                            ; set LEDs command
 00FFF78D 08DF8A                          bsr             KeybdSendByte
 00FFF78F 08DF8E                          bsr             KeybdWaitTx
 00FFF791 08DF6D                          bsr             KeybdRecvByte   ; should be an ack
 00FFF793 035004                          puls    b
 00FFF795 08DF82                          bsr             KeybdSendByte
 00FFF797 08DF86                          bsr             KeybdWaitTx
 00FFF799 08DF65                          bsr             KeybdRecvByte   ; should be an ack
 00FFF79B 039                             rts
 
                              ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                              ; Get ID - get the keyboards identifier code.
                              ;
                              ; Parameters: none
                              ; Returns: d = $AB83, $00 on fail
                              ; Modifies: d, KeybdID updated
                              ; Stack Space: 2 words
                              ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
                              KeybdGetID:
 00FFF79C 0C60F2                          ldb             #$F2
 00FFF79E 08DF79                          bsr             KeybdSendByte
 00FFF7A0 08DF7D                          bsr             KeybdWaitTx
 00FFF7A2 08DF5C                          bsr             KeybdRecvByte
 00FFF7A4 0C5080                          bitb    #$80
 00FFF7A6 026014                          bne             kgnotKbd
 00FFF7A8 0C10AB                          cmpb    #$AB
 00FFF7AA 026010                          bne             kgnotKbd
 00FFF7AC 08DF52                          bsr             KeybdRecvByte
 00FFF7AE 0C5080                          bitb    #$80
 00FFF7B0 02600A                          bne             kgnotKbd
 00FFF7B2 0C1083                          cmpb    #$83
 00FFF7B4 026006                          bne             kgnotKbd
 00FFF7B6 0CC00AB83                       ldd             #$AB83
                              kgid1:
 00FFF7B9 0DD124                          std             KeybdID
 00FFF7BB 039                             rts
                              kgnotKbd:
 00FFF7BC 04F                             clra
 00FFF7BD 05F                             clrb
 00FFF7BE 020FF9                          bra             kgid1
 
                              ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                              ; Initialize the keyboard.
                              ;
                              ; Parameters:
                              ;               none
                              ;       Modifies:
                              ;               none
                              ; Returns:
                              ;               none
                              ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
                              KeybdInit:
 00FFF7C0 034026                          pshs    d,y
 00FFF7C2 18E000005                       ldy             #5
                              kbdi0002:
 00FFF7C5 08DF72                          bsr             Wait10ms
 00FFF7C7 01507FFFFE30401                 clr             KEYBD+1                 ; clear receive register (write $00 to status reg)
 00FFF7CC 0C6FFF                          ldb             #-1                                     ; send reset code to keyboard
 00FFF7CE 0150F7FFFE30401                 stb             KEYBD+1                 ; write $FF to status reg to clear TX state
 00FFF7D3 08DF44                          bsr             KeybdSendByte   ; now write to transmit register
 00FFF7D5 08DF48                          bsr             KeybdWaitTx             ; wait until no longer busy
 00FFF7D7 08DF27                          bsr             KeybdRecvByte   ; look for an ACK ($FA)
 00FFF7D9 0C10FA                          cmpb    #$FA
 00FFF7DB 026021                          bne             kbdiTryAgain
 00FFF7DD 08DF21                          bsr             KeybdRecvByte   ; look for BAT completion code ($AA)
 00FFF7DF 0C10FC                          cmpb    #$FC                            ; reset error ?
 00FFF7E1 02701B                          beq             kbdiTryAgain
 00FFF7E3 0C10AA                          cmpb    #$AA                            ; reset complete okay ?
 00FFF7E5 026017                          bne             kbdiTryAgain
 
                                      ; After a reset, scan code set #2 should be active
                              .config:
 00FFF7E7 0C60F0                          ldb             #$F0                    ; send scan code select
 00FFF7E9 0150F7FFFE60000                 stb             LEDS
 00FFF7EE 08DF29                          bsr             KeybdSendByte
 00FFF7F0 08DF2D                          bsr             KeybdWaitTx
 00FFF7F2 05D                             tstb
 00FFF7F3 02B009                          bmi             kbdiTryAgain
 00FFF7F5 08DF09                          bsr             KeybdRecvByte   ; wait for response from keyboard
 00FFF7F7 04D                             tsta
 00FFF7F8 02B004                          bmi             kbdiTryAgain
 00FFF7FA 0C10FA                          cmpb    #$FA                                    ; ACK
 00FFF7FC 02700C                          beq             kbdi0004
                              kbdiTryAgain:
 00FFF7FE 0313FF                          dey
 00FFF800 026FC3                          bne       kbdi0002
                              .keybdErr:
 00FFF802 0CCFFF82A                       ldd             #msgBadKeybd
 00FFF805 017FFFB5A                       lbsr    DisplayStringCRLF
*** warning 1: Long branch within short branch range could be optimized
 00FFF808 020014                          bra             ledxit
                              kbdi0004:
 00FFF80A 0C6002                          ldb             #2                      ; select scan code set #2
 00FFF80C 08DF0B                          bsr             KeybdSendByte
 00FFF80E 08DF0F                          bsr             KeybdWaitTx
 00FFF810 05D                             tstb
 00FFF811 02BFEB                          bmi             kbdiTryAgain
 00FFF813 08DEEB                          bsr             KeybdRecvByte   ; wait for response from keyboard
 00FFF815 04D                             tsta
 00FFF816 02BFE6                          bmi             kbdiTryAgain
 00FFF818 0C10FA                          cmpb    #$FA
 00FFF81A 026FE2                          bne             kbdiTryAgain
 00FFF81C 08DF7E                          bsr             KeybdGetID
                              ledxit:
 00FFF81E 0C6007                          ldb             #$07
 00FFF820 08DF67                          bsr             KeybdSetLED
 00FFF822 08DF29                          bsr             Wait300ms
 00FFF824 0C6000                          ldb             #$00
 00FFF826 08DF61                          bsr             KeybdSetLED
 00FFF828 0350A6                          puls    d,y,pc
 
                              msgBadKeybd:
 00FFF82A 04B06507906206F061072           fcb             "Keyboard error",0
 00FFF831 06402006507207206F072
 00FFF838 000
 
                              ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                              ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
                              DBGCheckForKey:
 00FFF839 020F26                          bra             KeybdGetStatus
 
 
                              ; KeyState2 variable bit meanings
                              ;1176543210
                              ; ||||||||+ = shift
                              ; |||||||+- = alt
                              ; ||||||+-- = control
                              ; |||||+--- = numlock
                              ; ||||+---- = capslock
                              ; |||+----- = scrolllock
                              ; ||+------ = <empty>
                              ; |+------- =    "
                              ; |         =    "
                              ; |         =    "
                              ; |         =    "
                              ; +-------- = extended
 
                              ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                              ; Debug versison of keyboard get routine.
                              ;
                              ; Parameters:
                              ;               b:      0 = non blocking, otherwise blocking
                              ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
                              DBGGetKey:
 00FFF83B 034010                          pshs    x
                              dbgk2:
 00FFF83D 034004                          pshs    b
 00FFF83F 08DF20                          bsr             KeybdGetStatus
 00FFF841 0C4080                          andb    #$80                                                    ; is key available?
 00FFF843 035004                          puls    b
 00FFF845 026008                          bne             dbgk1                                                   ; branch if key
 00FFF847 05D                             tstb                                                                            ; block?
 00FFF848 026FF3                          bne             dbgk2                                                   ; If no key and blocking - loop
 00FFF84A 0CCFFFFFF                       ldd             #-1                                                             ; return -1 if no block and no key
 00FFF84D 035090                          puls    x,pc
                              dbgk1:
 00FFF84F 08DF2C                          bsr             KeybdGetScancode
                              ;       lbsr    DispByteAsHex
                                      ; Make sure there is a small delay between scancode reads
 00FFF851 08E000014                       ldx             #20
                              dbgk3:
 00FFF854 0301FF                          dex
 00FFF856 026FFC                          bne             dbgk3
                                      ; switch on scan code
 00FFF858 0C10F0                          cmpb    #SC_KEYUP
 00FFF85A 026006                          bne             dbgk4
 00FFF85C 00F120                          clr             KeyState1                                       ; make KeyState1 = -1
 00FFF85E 000120                          neg             KeyState1
 00FFF860 020FDB                          bra             dbgk2                                                   ; loop back
                              dbgk4:
 00FFF862 0C10E0                          cmpb    #SC_EXTEND
 00FFF864 026008                          bne             dbgk5
 00FFF866 096121                          lda             KeyState2
 00FFF868 08A800                          ora             #$800
 00FFF86A 097121                          sta             KeyState2
 00FFF86C 020FCF                          bra             dbgk2
                              dbgk5:
 00FFF86E 0C1014                          cmpb    #SC_CTRL
 00FFF870 026016                          bne             dbgkNotCtrl
 00FFF872 00D120                          tst             KeyState1
 00FFF874 02B008                          bmi             dbgk7
 00FFF876 096121                          lda             KeyState2
 00FFF878 08A004                          ora             #4
 00FFF87A 097121                          sta             KeyState2
 00FFF87C 020006                          bra             dbgk8
                              dbgk7:
 00FFF87E 096121                          lda             KeyState2
 00FFF880 084FFB                          anda    #~4
 00FFF882 097121                          sta             KeyState2
                              dbgk8:
 00FFF884 00F120                          clr             KeyState1
 00FFF886 020FB5                          bra             dbgk2
                              dbgkNotCtrl:
 00FFF888 0C1059                          cmpb    #SC_RSHIFT
 00FFF88A 026016                          bne             dbgkNotRshift
 00FFF88C 00D120                          tst             KeyState1
 00FFF88E 02B008                          bmi             dbgk9
 00FFF890 096121                          lda             KeyState2
 00FFF892 08A001                          ora             #1
 00FFF894 097121                          sta             KeyState2
 00FFF896 020006                          bra             dbgk10
                              dbgk9:
 00FFF898 096121                          lda             KeyState2
 00FFF89A 084FFE                          anda    #~1
 00FFF89C 097121                          sta             KeyState2
                              dbgk10:
 00FFF89E 00F120                          clr             KeyState1
 00FFF8A0 020F9B                          bra             dbgk2
                              dbgkNotRshift:
 00FFF8A2 0C1077                          cmpb    #SC_NUMLOCK
 00FFF8A4 026013                          bne             dbgkNotNumlock
 00FFF8A6 096121                          lda             KeyState2
 00FFF8A8 088010                          eora    #16
 00FFF8AA 097121                          sta             KeyState2
 00FFF8AC 096122                          lda             KeyLED
 00FFF8AE 088002                          eora    #2
 00FFF8B0 097122                          sta             KeyLED
 00FFF8B2 01F089                          tfr             a,b
 00FFF8B4 04F                             clra
 00FFF8B5 08DED2                          bsr             KeybdSetLED
 00FFF8B7 020F84                          bra             dbgk2
                              dbgkNotNumlock:
 00FFF8B9 0C1058                          cmpb    #SC_CAPSLOCK
 00FFF8BB 026013                          bne             dbgkNotCapslock
 00FFF8BD 096121                          lda             KeyState2
 00FFF8BF 088020                          eora    #32
 00FFF8C1 097121                          sta             KeyState2
 00FFF8C3 096122                          lda             KeyLED
 00FFF8C5 088004                          eora    #4
 00FFF8C7 097122                          sta             KeyLED
 00FFF8C9 01F089                          tfr             a,b
 00FFF8CB 04F                             clra
 00FFF8CC 08DEBB                          bsr             KeybdSetLED
 00FFF8CE 020F6D                          bra             dbgk2
                              dbgkNotCapslock:
 00FFF8D0 0C107E                          cmpb    #SC_SCROLLLOCK
 00FFF8D2 026013                          bne             dbgkNotScrolllock
 00FFF8D4 096121                          lda             KeyState2
 00FFF8D6 088040                          eora    #64
 00FFF8D8 097121                          sta             KeyState2
 00FFF8DA 096122                          lda             KeyLED
 00FFF8DC 088001                          eora    #1
 00FFF8DE 097122                          sta             KeyLED
 00FFF8E0 01F089                          tfr             a,b
 00FFF8E2 04F                             clra
 00FFF8E3 08DEA4                          bsr             KeybdSetLED
 00FFF8E5 020F56                          bra             dbgk2
                              dbgkNotScrolllock:
 00FFF8E7 0C1011                          cmpb    #SC_ALT
 00FFF8E9 026016                          bne             dbgkNotAlt
 00FFF8EB 00D120                          tst             KeyState1
 00FFF8ED 02B008                          bmi             dbgk11
 00FFF8EF 096121                          lda             KeyState2
 00FFF8F1 08A002                          ora             #2
 00FFF8F3 097121                          sta             KeyState2
 00FFF8F5 020006                          bra             dbgk12
                              dbgk11:
 00FFF8F7 096121                          lda             KeyState2
 00FFF8F9 084FFD                          anda    #~2
 00FFF8FB 097121                          sta             KeyState2
                              dbgk12:
 00FFF8FD 00F120                          clr             KeyState1
 00FFF8FF 020F3C                          bra             dbgk2
                              dbgkNotAlt:
 00FFF901 00D120                          tst             KeyState1
 00FFF903 027004                          beq             dbgk13
 00FFF905 00F120                          clr             KeyState1
 00FFF907 020F34                          bra             dbgk2
                              dbgk13:
 00FFF909 096121                          lda             KeyState2               ; Check for CTRL-ALT-DEL
 00FFF90B 084006                          anda    #6
 00FFF90D 081006                          cmpa    #6
 00FFF90F 026008                          bne             dbgk14
 00FFF911 0C1071                          cmpb    #SC_DEL 
 00FFF913 026004                          bne             dbgk14
 00FFF915 06E90FFFFFFE                    jmp             [$FFFFFE]               ; jump to reset vector
                              dbgk14:
 00FFF919 00D121                          tst             KeyState2               ; extended code?
 00FFF91B 02A00B                          bpl             dbgk15
 00FFF91D 096121                          lda             KeyState2
 00FFF91F 0847FF                          anda    #$7FF
 00FFF921 097121                          sta             KeyState2
 00FFF923 08EFFF680                       ldx             #keybdExtendedCodes
 00FFF926 020017                          bra             dbgk18
                              dbgk15:
 00FFF928 096121                          lda             KeyState2               ; Is CTRL down?
 00FFF92A 085004                          bita    #4
 00FFF92C 027005                          beq             dbgk16
 00FFF92E 08EFFF600                       ldx             #keybdControlCodes
 00FFF931 02000C                          bra             dbgk18
                              dbgk16:
 00FFF933 085001                          bita    #1                                      ; Is shift down?
 00FFF935 027005                          beq             dbgk17
 00FFF937 08EFFF500                       ldx             #shiftedScanCodes
 00FFF93A 020003                          bra             dbgk18
                              dbgk17:
 00FFF93C 08EFFF400                       ldx             #unshiftedScanCodes
                              dbgk18:
 00FFF93F 03A                             abx
 00FFF940 0E6804                          ldb             ,x
 00FFF942 04F                             clra
 00FFF943 035090                          puls    x,pc                            ; and return
                                      
 
 00FFF945 04B04505904204F041052           fcb             "KEYBOARD"
 00FFF94C 044
 00FFF94D FFF957                          fcw             KeybdOpen
 00FFF94F FFF958                          fcw             KeybdClose
 00FFF951 FFF959                          fcw             KeybdRead
 00FFF953 FFF95A                          fcw             KeybdWrite
 00FFF955 FFF95B                          fcw             KeybdSeek
 
                              ; Keyboard Open:
                              ; Initialize the keyboard buffer head and tail indexes
                              ;
                              KeybdOpen:
 00FFF957 039                             rts
 
                              ; Keyboard Close:
                              ; Nothing to do except maybe clear the keyboard buffer
                              ;
                              KeybdClose:
 00FFF958 039                             rts
                              ;
                              KeybdRead:
 00FFF959 039                             rts
                              ;
                              KeybdWrite:
 00FFF95A 039                             rts
 
                              KeybdSeek:
 00FFF95B 039                             rts
 
                              ;------------------------------------------------------------------------------
                              ; Check if there is a keyboard character available. If so return true (<0)
                              ; otherwise return false (0) in accb.
                              ;------------------------------------------------------------------------------
                              ;
                              KeybdCheckForKeyDirect:
 00FFF95C 020EDB                          bra             DBGCheckForKey
 
                              ;------------------------------------------------------------------------------
                              ;------------------------------------------------------------------------------
                              INCH:
 00FFF95E 0CCFFFFFF                       ldd             #-1                             ; block if no key available
 00FFF961 020ED8                          bra             DBGGetKey
 
                              INCHE:
 00FFF963 08DFF9                          bsr             INCH
 00FFF965 020009                          bra             INCHEK3
 
                              INCHEK:
 00FFF967 08DFF5                          bsr             INCH
 00FFF969 01507DFFFFFCA00                 tst             KeybdEcho
 00FFF96E 02700B                          beq             INCHEK1
                              INCHEK3:
 00FFF970 08100D                          cmpa    #CR
 00FFF972 026005                          bne             INCHEK2
 00FFF974 017FFD75B                       lbsr            CRLF
*** warning 1: Long branch within short branch range could be optimized
 00FFF977 020002                          bra             INCHEK1
                              INCHEK2:
 00FFF979 08D920                          bsr             DisplayChar
                              INCHEK1:
 00FFF97B 039                             rts
 
                              OUTCH:
 00FFF97C 06E90F000800                    jmp             [CharOutVec]
 
                              ;------------------------------------------------------------------------------
                              ; r1 0=echo off, non-zero = echo on
                              ;------------------------------------------------------------------------------
                              ;
                              SetKeyboardEcho:
 00FFF980 0150F7FFFFFCA00                 stb             KeybdEcho
 00FFF985 039                             rts
 
 
                              ;------------------------------------------------------------------------------
                              ; Parameters:
                              ;               x,d     bitmap of sprites to enable
                              ;------------------------------------------------------------------------------
 
                              ShowSprites:
 00FFF986 0150BFFFFE103C0                 stx             SPRITE_CTRL+SPRITE_EN
 00FFF98B 0150FDFFFE103C2                 std             SPRITE_CTRL+SPRITE_EN+2
 00FFF990 039                             rts
 
                              ;==============================================================================
                              ; System Monitor
                              ;==============================================================================
                              ;
                              MonitorStart:
 00FFF991 0CCFFFAEF                       ldd             #HelpMsg
 00FFF994 08D9BE                          bsr             DisplayString
                              Monitor:
 00FFF996 03280F003FFF                    leas    $3FFF                           ; reset stack pointer
 00FFF99A 05F                             clrb                                                    ; turn off keyboard echo
 00FFF99B 08DFE3                          bsr             SetKeyboardEcho
                              ;       jsr             RequestIOFocus
                              PromptLn:
 00FFF99D 017FFD732                       lbsr    CRLF
*** warning 1: Long branch within short branch range could be optimized
 00FFF9A0 0C6024                          ldb             #'$'
 00FFF9A2 08DFD8                          bsr             OUTCH
 
                              ; Get characters until a CR is keyed
                                      
                              Prompt3:
 00FFF9A4 0CCFFFFFF                       ldd             #-1                                     ; block until key present
 00FFF9A7 08DE92                          bsr             DBGGetKey
 00FFF9A9 0C100D                          cmpb    #CR
 00FFF9AB 027004                          beq             Prompt1
 00FFF9AD 08DFCD                          bsr             OUTCH
 00FFF9AF 020FF3                          bra             Prompt3
 
                              ; Process the screen line that the CR was keyed on
                              ;
                              Prompt1:
 00FFF9B1 0CC005050                       ldd             #$5050
 00FFF9B4 0150FDFFFE60000                 std             LEDS
 00FFF9B9 0F6800000                       ldb             RunningID
 00FFF9BC 0C103D                          cmpb    #61
 00FFF9BE 022FE4                          bhi             Prompt3
 00FFF9C0 0CC005151                       ldd             #$5151
 00FFF9C3 0150FDFFFE60000                 std             LEDS
 00FFF9C8 00F111                          clr             CursorCol                       ; go back to the start of the line
 00FFF9CA 08D8AD                          bsr             CalcScreenLoc   ; calc screen memory location
 00FFF9CC 01F002                          tfr             d,y
 00FFF9CE 0CC005252                       ldd             #$5252
 00FFF9D1 0150FDFFFE60000                 std             LEDS
 00FFF9D6 08D055                          bsr             MonGetNonSpace
 00FFF9D8 0C1024                          cmpb    #'$'
 00FFF9DA 026009                          bne             Prompt2                 ; skip over '$' prompt character
 00FFF9DC 086353                          lda             #$5353
 00FFF9DE 0150FDFFFE60000                 std             LEDS
 00FFF9E3 08D048                          bsr             MonGetNonSpace
 
                              ; Dispatch based on command character
                              ;
                              Prompt2:
 00FFF9E5 0C103F                          cmpb    #'?'                    ; $? - display help
 00FFF9E7 026007                          bne             PromptC
 00FFF9E9 0CCFFFAEF                       ldd             #HelpMsg
 00FFF9EC 08D966                          bsr             DisplayString
 00FFF9EE 020FA6                          bra             Monitor
                              PromptC:
 00FFF9F0 0C1043                          cmpb    #'C'
 00FFF9F2 026007                          bne             PromptD
 00FFF9F4 017FFF7D9                       lbsr            ClearScreen
*** warning 1: Long branch within short branch range could be optimized
 00FFF9F7 08D848                          bsr             HomeCursor
 00FFF9F9 020F9B                          bra             Monitor
                              PromptD:
 00FFF9FB 0C1044                          cmpb    #'D'
 00FFF9FD 026008                          bne             PromptF
 00FFF9FF 08D027                          bsr             MonGetch
 00FFFA01 0C1052                          cmpb    #'R'
 00FFFA03 026F9F                          bne             Prompt3
 00FFFA05 020193                          bra             DumpRegs
                              PromptF:
 00FFFA07 0C1046                          cmpb    #'F'
 00FFFA09 02600F                          bne             PromptJ
 00FFFA0B 08D01B                          bsr             MonGetch
 00FFFA0D 0C1049                          cmpb    #'I'
 00FFFA0F 026F85                          bne             Monitor
 00FFFA11 08D015                          bsr             MonGetch
 00FFFA13 0C1047                          cmpb    #'G'
 00FFFA15 026F7F                          bne             Monitor
 00FFFA17 07EFE0000                       jmp             $FE0000
                              PromptJ:
 00FFFA1A 0C104A                          cmpb    #'J'
 00FFFA1C 1270001BF                       lbeq    jump_to_code
                              PromptR:
 00FFFA1F 0C1052                          cmpb    #'R'
 00FFFA21 026F73                          bne             Monitor
 00FFFA23 017FFE5DA                       lbsr    ramtest
*** warning 1: Long branch within short branch range could be optimized
 00FFFA26 020F6E                          bra             Monitor
 
                              MonGetch:
 00FFFA28 0E6A04                          ldb             ,y
 00FFFA2A 031201                          leay    1,y
 00FFFA2C 039                             rts
 
                              MonGetNonSpace:
 00FFFA2D 08DFF9                          bsr             MonGetCh
 00FFFA2F 0C1020                          cmpb    #' '
 00FFFA31 027FFA                          beq             MonGetNonSpace
 00FFFA33 0C1009                          cmpb    #9              ; tab
 00FFFA35 027FF6                          beq             MonGetNonSpace
 00FFFA37 039                             rts
 
                              ;------------------------------------------------------------------------------
                              ; Ignore blanks in the input
                              ; Y = text pointer
                              ; D destroyed
                              ;------------------------------------------------------------------------------
                              ;
                              ignBlanks:
                              ignBlanks1:
 00FFFA38 08DFEE                          bsr             MonGetch
 00FFFA3A 0C1020                          cmpb    #' '
 00FFFA3C 027FFA                          beq             ignBlanks1
 00FFFA3E 0313FF                          leay    -1,y
 00FFFA40 039                             rts
 
                              ;------------------------------------------------------------------------------
                              ;------------------------------------------------------------------------------
                              GetTwoParams:
 00FFFA41 08DFF5                          bsr             ignBlanks
 00FFFA43 08D02E                          bsr             GetHexNumber    ; get start address of dump
 00FFFA45 0DC910                          ldd             mon_numwka
 00FFFA47 0DD920                          std             mon_r1
 00FFFA49 0DC912                          ldd             mon_numwka+2
 00FFFA4B 0DD922                          std             mon_r1+2
 00FFFA4D 08DFE9                          bsr             ignBlanks
 00FFFA4F 08D022                          bsr             GetHexNumber    ; get end address of dump
 00FFFA51 0DC910                          ldd             mon_numwka
 00FFFA53 0DD922                          std             mon_r2
 00FFFA55 0DC912                          ldd             mon_numwka+2
 00FFFA57 0DD924                          std             mon_r2+2
 00FFFA59 039                             rts
 
                              ;------------------------------------------------------------------------------
                              ; Get a range, the end must be greater or equal to the start.
                              ;------------------------------------------------------------------------------
                              GetRange:
 00FFFA5A 08DFE5                          bsr             GetTwoParams
 00FFFA5C 0DC924                          ldd             mon_r2+2
 00FFFA5E 093922                          subd    mon_r1+2
 00FFFA60 0DC922                          ldd             mon_r2
 00FFFA62 0D2921                          sbcb    mon_r1+1
 00FFFA64 092920                          sbca    mon_r1
 00FFFA66 12500006C                       lbcs    DisplayErr
 00FFFA69 039                             rts
 
                              shl_numwka:
 00FFFA6A 008913                          asl             mon_numwka+3
 00FFFA6C 009912                          rol             mon_numwka+2
 00FFFA6E 009911                          rol             mon_numwka+1
 00FFFA70 009910                          rol             mon_numwka
 00FFFA72 039                             rts
 
                              ;------------------------------------------------------------------------------
                              ; Get a hexidecimal number. Maximum of nine digits.
                              ; Y = text pointer (updated)
                              ; D = number of digits
                              ; mon_numwka contains number
                              ;------------------------------------------------------------------------------
                              ;
                              GetHexNumber:
 00FFFA73 04F05F                          clrd
 00FFFA75 0DD910                          std             mon_numwka
 00FFFA77 0DD912                          std             mon_numwka+2
 00FFFA79 034010                          pshs    x
 00FFFA7B 08E000000                       ldx             #0                                      ; max 9 eight digits
                              gthxn2:
 00FFFA7E 08DFA8                          bsr             MonGetch
 00FFFA80 08D01D                          bsr             AsciiToHexNybble
 00FFFA82 0C1FFF                          cmpb    #-1
 00FFFA84 027015                          beq             gthxn1
 00FFFA86 08DFE2                          bsr             shl_numwka
 00FFFA88 08DFE0                          bsr             shl_numwka
 00FFFA8A 08DFDE                          bsr             shl_numwka
 00FFFA8C 08DFDC                          bsr             shl_numwka
 00FFFA8E 0C400F                          andb    #$0f
 00FFFA90 0DA913                          orb             mon_numwka+3
 00FFFA92 0D7913                          stb             mon_numwka+3
 00FFFA94 030001                          inx
 00FFFA96 08C000009                       cmpx    #9
 00FFFA99 025FE3                          blo             gthxn2
                              gthxn1:
 00FFFA9B 01F010                          tfr             x,d
 00FFFA9D 035090                          puls    x,pc
 
                              ;GetDecNumber:
                              ;       phx
                              ;       push    r4
                              ;       push    r5
                              ;       ldx             #0
                              ;       ld              r4,#10
                              ;       ld              r5,#10
                              ;gtdcn2:
                              ;       jsr             MonGetch
                              ;       jsr             AsciiToDecNybble
                              ;       cmp             #-1
                              ;       beq             gtdcn1
                              ;       mul             r2,r2,r5
                              ;       add             r2,r1
                              ;       dec             r4
                              ;       bne             gtdcn2
                              ;gtdcn1:
                              ;       txa
                              ;       pop             r5
                              ;       pop             r4
                              ;       plx
                              ;       rts
 
                              ;------------------------------------------------------------------------------
                              ; Convert ASCII character in the range '0' to '9', 'a' to 'f' or 'A' to 'F'
                              ; to a hex nybble.
                              ;------------------------------------------------------------------------------
                              ;
                              AsciiToHexNybble:
 00FFFA9F 0C1030                          cmpb    #'0'
 00FFFAA1 024021                          bcc             gthx3
 00FFFAA3 0C103A                          cmpb    #'9'+1
 00FFFAA5 025003                          bcs             gthx5
 00FFFAA7 0C0030                          subb    #'0'
 00FFFAA9 039                             rts
                              gthx5:
 00FFFAAA 0C1041                          cmpb    #'A'
 00FFFAAC 024016                          bcc             gthx3
 00FFFAAE 0C1047                          cmpb    #'F'+1
 00FFFAB0 025005                          bcs             gthx6
 00FFFAB2 0C0041                          subb    #'A'
 00FFFAB4 0CB00A                          addb    #10
 00FFFAB6 039                             rts
                              gthx6:
 00FFFAB7 0C1061                          cmpb    #'a'
 00FFFAB9 024009                          bcc             gthx3
 00FFFABB 0C107B                          cmpb    #'z'+1
 00FFFABD 025005                          bcs             gthx3
 00FFFABF 0C0061                          subb    #'a'
 00FFFAC1 0CB00A                          addb    #10
 00FFFAC3 039                             rts
                              gthx3:
 00FFFAC4 0C6FFF                          ldb             #-1             ; not a hex number
 00FFFAC6 039                             rts
 
                              AsciiToDecNybble:
 00FFFAC7 0C1030                          cmpb    #'0'
 00FFFAC9 024007                          bcc             gtdc3
 00FFFACB 0C103A                          cmpb    #'9'+1
 00FFFACD 025003                          bcs             gtdc3
 00FFFACF 0C0030                          subb    #'0'
 00FFFAD1 039                             rts
                              gtdc3:
 00FFFAD2 0C6FFF                          ldb             #-1
 00FFFAD4 039                             rts
 
                              DisplayErr:
 00FFFAD5 08EFFFAE7                       ldx             #msgErr
 00FFFAD8 04F05F                          clrd
 00FFFADA 08D003                          bsr             DisplayStringDX
 00FFFADC 07EFFF996                       jmp             Monitor
 
                              DisplayStringDX
 00FFFADF 0DD024                          std             Strptr
 00FFFAE1 09F026                          stx             Strptr+2
 00FFFAE3 0BDFFF354                       jsr             DisplayString
 00FFFAE6 039                             rts
 
                              msgErr:
 00FFFAE7 02A02A04507207200D00A           fcb     "**Err",CR,LF,0
 00FFFAEE 000
 
                              HelpMsg:
 00FFFAEF 03F02003D020044069073           fcb             "? = Display help",CR,LF
 00FFFAF6 07006C061079020068065
 00FFFAFD 06C07000D00A
 00FFFB01 04304C05302003D020063           fcb     "CLS = clear screen",CR,LF
 00FFFB08 06C065061072020073063
 00FFFB0F 07206506506E00D00A
                              ;       db      "S = Boot from SD Card",CR,LF
                              ;       db      ": = Edit memory bytes",CR,LF
                              ;       db      "L = Load sector",CR,LF
                              ;       db      "W = Write sector",CR,LF
 00FFFB15 04405202003D020044075           fcb "DR = Dump registers",CR,LF
 00FFFB1C 06D070020072065067069
 00FFFB23 07307406507207300D00A
                              ;       db      "D = Dump memory",CR,LF
                              ;       db      "F = Fill memory",CR,LF
                              ;       db  "FL = Dump I/O Focus List",CR,LF
 00FFFB2A 04604904702003D020073           fcb "FIG = start FIG Forth",CR,LF
 00FFFB31 074061072074020046049
 00FFFB38 04702004606F072074068
 00FFFB3F 00D00A
                              ;       db      "KILL n = kill task #n",CR,LF
                              ;       db      "B = start tiny basic",CR,LF
                              ;       db      "b = start EhBasic 6502",CR,LF
 00FFFB41 04A02003D02004A07506D           fcb     "J = Jump to code",CR,LF
 00FFFB48 07002007406F02006306F
 00FFFB4F 06406500D00A
 00FFFB53 05204104D02003D020074           fcb "RAM = test RAM",CR,LF
 00FFFB5A 06507307402005204104D
 00FFFB61 00D00A
                              ;       db      "R[n] = Set register value",CR,LF
                              ;       db      "r = random lines - test bitmap",CR,LF
                              ;       db      "e = ethernet test",CR,LF
                              ;       db      "T = Dump task list",CR,LF
                              ;       db      "TO = Dump timeout list",CR,LF
                              ;       db      "TI = display date/time",CR,LF
                              ;       db      "TEMP = display temperature",CR,LF
                              ;       db      "P = Piano",CR,LF,0
 00FFFB63 000                             fcb             0
 
                              msgRegHeadings
 00FFFB64 00D00A02004402F041042           fcb     CR,LF," D/AB   X    Y    U    S     PC    DP CCR",CR,LF,0
 00FFFB6B 020020020058020020020
 00FFFB72 020059020020020020055
 00FFFB79 020020020020053020020
 00FFFB80 020020020050043020020
 00FFFB87 020020044050020043043
 00FFFB8E 05200D00A000
 
                              nHEX4:
 00FFFB92 0BDFFD2D2                       jsr             HEX4
 00FFFB95 039                             rts
 
                              nXBLANK:
 00FFFB96 0C6020                          ldb             #' '
 00FFFB98 020DE2                          bra             OUTCH
 
                              DumpRegs
 00FFFB9A 08EFFFB64                       ldx             #msgRegHeadings
 00FFFB9D 0CC0000FF                       ldd             #msgRegHeadings>>16
 00FFFBA0 0BDFFFADF                       jsr             DisplayStringDX
 00FFFBA3 08DFF1                          bsr             nXBLANK
 00FFFBA5 0DC900                          ldd             mon_DSAVE
 00FFFBA7 08DFE9                          bsr             nHEX4
 00FFFBA9 08DFEB                          bsr             nXBLANK
 00FFFBAB 0DC902                          ldd             mon_XSAVE
 00FFFBAD 08DFE3                          bsr             nHEX4
 00FFFBAF 08DFE5                          bsr             nXBLANK
 00FFFBB1 0DC904                          ldd             mon_YSAVE
 00FFFBB3 08DFDD                          bsr             nHEX4
 00FFFBB5 08DFDF                          bsr             nXBLANK
 00FFFBB7 0DC906                          ldd             mon_USAVE
 00FFFBB9 08DFD7                          bsr             nHEX4
 00FFFBBB 08DFD9                          bsr             nXBLANK
 00FFFBBD 0DC908                          ldd             mon_SSAVE
 00FFFBBF 08DFD1                          bsr             nHEX4
 00FFFBC1 08DFD3                          bsr             nXBLANK
 00FFFBC3 0DC90A                          ldd             mon_PCSAVE
 00FFFBC5 08DFCB                          bsr             nHEX4
 00FFFBC7 0DC90C                          ldd             mon_PCSAVE+2
 00FFFBC9 08DFC7                          bsr             nHEX4
 00FFFBCB 08DFC9                          bsr             nXBLANK
 00FFFBCD 0DC90E                          ldd             mon_DPRSAVE
 00FFFBCF 0BDFFD2CE                       jsr             HEX2
 00FFFBD2 08DFC2                          bsr             nXBLANK
 00FFFBD4 09690F                          lda             mon_CCRSAVE
 00FFFBD6 0BDFFD2CE                       jsr             HEX2
 00FFFBD9 08DFBB                          bsr             nXBLANK
 00FFFBDB 07EFFF996                       jmp             Monitor
 
                              ; Jump to code
                              jump_to_code:
 00FFFBDE 08DE93                          bsr             GetHexNumber
 00FFFBE0 01A010                          sei
 00FFFBE2 1DE908                          lds             mon_SSAVE
 00FFFBE4 0CCFFFC11                       ldd             #<jtc_exit
 00FFFBE7 034006                          pshs    d
 00FFFBE9 0CC000000                       ldd             #>jtc_exit
 00FFFBEC 034004                          pshs    b
 00FFFBEE 0DC912                          ldd             mon_numwka+2
 00FFFBF0 034006                          pshs    d
 00FFFBF2 0DC910                          ldd             mon_numwka
 00FFFBF4 034006                          pshs    d
 00FFFBF6 0DC906                          ldd             mon_USAVE
 00FFFBF8 034006                          pshs    d
 00FFFBFA 0DC904                          ldd             mon_YSAVE
 00FFFBFC 034006                          pshs    d
 00FFFBFE 0DC902                          ldd             mon_XSAVE
 00FFFC00 034006                          pshs    d
 00FFFC02 09690E                          lda             mon_DPRSave
 00FFFC04 034002                          pshs    a
 00FFFC06 0DC900                          ldd             mon_DSAVE
 00FFFC08 034006                          pshs    d
 00FFFC0A 09690F                          lda             mon_CCRSAVE
 00FFFC0C 034002                          pshs    a
 00FFFC0E 0150350FF                       puls    far ccr,d,dpr,x,y,u,pc
                              jtc_exit:
 00FFFC11 034001                          pshs    ccr
 00FFFC13 0DD900                          std             mon_DSAVE
 00FFFC15 09F902                          stx             mon_XSAVE
 00FFFC17 19F904                          sty             mon_YSAVE
 00FFFC19 0DF906                          stu             mon_USAVE
 00FFFC1B 01F0B8                          tfr             dpr,a
 00FFFC1D 09790E                          sta             mon_DPRSAVE
 00FFFC1F 035002                          puls    a
 00FFFC21 09790F                          sta             mon_CCRSAVE
 00FFFC23 1DF908                          sts             mon_SSAVE
 00FFFC25 1CE003FFF                       lds             #$3FFF
                                      ; todo set according to coreid
 00FFFC28 07EFFFB9A                       jmp             DumpRegs
 
                              ;------------------------------------------------------------------------------
                              ;------------------------------------------------------------------------------
                              swi3_rout:
 00FFFC2B 01A010                          sei
 00FFFC2D 035002                          puls    a
 00FFFC2F 09790F                          sta             mon_CCRSAVE
 00FFFC31 03507E                          puls    D,DPR,X,Y,U
 00FFFC33 0DD900                          std             mon_DSAVE
 00FFFC35 09F902                          stx             mon_XSAVE
 00FFFC37 19F904                          sty             mon_YSAVE
 00FFFC39 0DF906                          stu             mon_USAVE
 00FFFC3B 01F0B8                          tfr             dpr,a
 00FFFC3D 09790E                          sta             mon_DPRSAVE
 00FFFC3F 035006                          puls    D
 00FFFC41 0DD90A                          std             mon_PCSAVE
 00FFFC43 035006                          puls    D
 00FFFC45 0DD90C                          std             mon_PCSAVE+2
 00FFFC47 1DF908                          sts             mon_SSAVE
 00FFFC49 1CE003FFF                       lds             #$3FFF
 00FFFC4C 01C0EF                          cli
 00FFFC4E 07EFFFB9A                       jmp             DumpRegs
                              swi3_exit:
 00FFFC51 01A010                          sei
 00FFFC53 1DE908                          lds             mon_SSAVE
 00FFFC55 0DC90C                          ldd             mon_PCSAVE+2
 00FFFC57 034006                          pshs    d
 00FFFC59 0DC90A                          ldd             mon_PCSAVE
 00FFFC5B 034006                          pshs    d
 00FFFC5D 0DE906                          ldu             mon_USAVE
 00FFFC5F 19E904                          ldy             mon_YSAVE
 00FFFC61 09E902                          ldx             mon_XSAVE
 00FFFC63 034070                          pshs    x,y,u
 00FFFC65 09690E                          lda             mon_DPRSAVE
 00FFFC67 034002                          pshs    a
 00FFFC69 0DC900                          ldd             mon_DSAVE
 00FFFC6B 034006                          pshs    d
 00FFFC6D 09690F                          lda             mon_CCRSAVE
 00FFFC6F 034002                          pshs    a
 00FFFC71 01F08A                          tfr             a,ccr
 00FFFC73 01C0EF                          cli
 00FFFC75 03B                             rti
 
                              ;------------------------------------------------------------------------------
                              ;------------------------------------------------------------------------------
                              irq_rout:
                                      ; Reset the edge sense circuit in the PIC
 00FFFC76 086002                          lda             #2                              ; Timer is IRQ #2
 00FFFC78 0150B7FFFE3F006                 sta             PIC+6                   ; register 6 is edge sense reset reg    
 
 00FFFC7D 09779A                          sta             IrqSource               ; stuff a byte indicating the IRQ source for PEEK()
 00FFFC7F 0960DF                          lda             IrqBase                 ; get the IRQ flag byte
 00FFFC81 044                             lsra
 00FFFC82 09A0DF                          ora             IrqBase
 00FFFC84 0840E0                          anda    #$E0
 00FFFC86 0970DF                          sta             IrqBase
 
 00FFFC88 01507CFFFE0006E                 inc             TEXTSCR+110             ; update IRQ live indicator on screen
                                      
                                      ; flash the cursor
                                      ; only bother to flash the cursor for the task with the IO focus.
 00FFFC8D 0150B6FFFFFFFE0                 lda             COREID
 00FFFC92 091100                          cmpa    IOFocusID
 00FFFC94 026021                          bne             tr1a
 00FFFC96 096114                          lda             CursorFlash             ; test if we want a flashing cursor
 00FFFC98 02701D                          beq             tr1a
 00FFFC9A 017FFF5DC                       lbsr    CalcScreenLoc   ; compute cursor location in memory
*** warning 1: Long branch within short branch range could be optimized
 00FFFC9D 01F002                          tfr             d,y
 00FFFC9F 0A6A09002000                    lda             $2000,y                 ; get color code $2000 higher in memory
 00FFFCA3 0D67C6                          ldb             IRQFlag                 ; get counter
 00FFFCA5 054                             lsrb
 00FFFCA6 044                             lsra
 00FFFCA7 044                             lsra
 00FFFCA8 044                             lsra
 00FFFCA9 044                             lsra
 00FFFCAA 054                             lsrb
 00FFFCAB 049                             rola
 00FFFCAC 054                             lsrb
 00FFFCAD 049                             rola
 00FFFCAE 054                             lsrb
 00FFFCAF 049                             rola
 00FFFCB0 054                             lsrb
 00FFFCB1 049                             rola
 00FFFCB2 0A7A0A000E00000                 sta             $E00000,y               ; store the color code back to memory
                              tr1a
 00FFFCB7 03B                             rti
 
                              ;------------------------------------------------------------------------------
                              ;------------------------------------------------------------------------------
                              nmi_rout:
 00FFFCB8 0150F6FFFFFFFE0                 ldb             COREID
 00FFFCBD 086049                          lda             #'I'
 00FFFCBF 08EE00028                       ldx             #TEXTSCR+40
 00FFFCC2 03A                             abx
 00FFFCC3 0A7804                          sta             ,x
 00FFFCC5 03B                             rti
 
                                      org             $FFFFF0
 00FFFFF0 012                             nop
 00FFFFF1 012                             nop
 00FFFFF2 FFFC2B                          fcw             swi3_rout
 
                                      org             $FFFFF8
 00FFFFF8 FFFC76                          fcw             irq_rout
 00FFFFFA FFF023                          fcw             start                           ; SWI
 00FFFFFC FFFCB8                          fcw             nmi_rout                ; NMI
 00FFFFFE FFF023                          fcw             start                           ; RST

8 warning(s) in pass 2.

SYMBOL TABLE
 ASCIITODECNYBBLE 02 00FFFAC7 ASCIITOHEXNYBBLE 02 00FFFA9F BIOS_SCREENS 00 17000000 BLANKLINE 02 00FFF216
 BLKCPYDST 00 00000020 BLKCPYSRC 00 0000001C   BLNKLN1 02 00FFF229 CALCSCREENLOC 02 00FFF279
 CHARCOLOR 00 00000112 CHARINVEC 00 00000804 CHAROUTVEC 00 00000800 CHECKPOINT 02 00FFF0E0
 CLEARSCREEN 02 00FFF1D0 CLEARSCREENJMP 02 00FFD300 COLORCODELOCATION 00 00000014 COPYSCREENTOVIRTUALSCREEN 02 00FFF1A0
 COPYVIRTUALSCREENTOSCREEN 02 00FFF178    COREID 00 FFFFFFE0        CR 00 0000000D      CRLF 02 00FFD0D2
     CRLF1 02 00FFD0D2    CRLFST 02 00FFF388       CS1 02 00FFF1DD       CS2 02 00FFF1F3
     CS2V1 02 00FFF1AC       CS3 02 00FFF1F9      CSL1 02 00FFF293     CTRLC 00 00000003
     CTRLH 00 00000008     CTRLI 00 00000009     CTRLJ 00 0000000A     CTRLK 00 0000000B
     CTRLM 00 0000000D     CTRLS 00 00000013     CTRLX 00 00000018 CURSORCOL 00 00000111
 CURSORFLASH 00 00000114 CURSORROW 00 00000110     CV2S1 02 00FFF184 DBGCHECKFORKEY 02 00FFF839
 DBGGETKEY 02 00FFF83B     DBGK1 02 00FFF84F    DBGK10 02 00FFF89E    DBGK11 02 00FFF8F7
    DBGK12 02 00FFF8FD    DBGK13 02 00FFF909    DBGK14 02 00FFF919    DBGK15 02 00FFF928
    DBGK16 02 00FFF933    DBGK17 02 00FFF93C    DBGK18 02 00FFF93F     DBGK2 02 00FFF83D
     DBGK3 02 00FFF854     DBGK4 02 00FFF862     DBGK5 02 00FFF86E     DBGK7 02 00FFF87E
     DBGK8 02 00FFF884     DBGK9 02 00FFF898 DBGKNOTALT 02 00FFF901 DBGKNOTCAPSLOCK 02 00FFF8D0
 DBGKNOTCTRL 02 00FFF888 DBGKNOTNUMLOCK 02 00FFF8B9 DBGKNOTRSHIFT 02 00FFF8A2 DBGKNOTSCROLLLOCK 02 00FFF8E7
      DCCR 02 00FFF2A7      DCLF 02 00FFF32D     DCX10 02 00FFF2E1     DCX11 02 00FFF2F1
     DCX12 02 00FFF2ED     DCX13 02 00FFF2FD     DCX14 02 00FFF2A5      DCX3 02 00FFF31B
      DCX4 02 00FFF32F      DCX5 02 00FFF30A      DCX6 02 00FFF2B8      DCX7 02 00FFF2B4
      DCX8 02 00FFF2C5      DCX9 02 00FFF2D2   DELAY3S 02 00FFF15B DISPBYTEASHEX 02 00FFF39D
 DISPDWORDASHEX 02 00FFF38B DISPLAYCHAR 02 00FFF29B DISPLAYERR 02 00FFFAD5 DISPLAYSTRING 02 00FFF354
 DISPLAYSTRINGCRLF 02 00FFF362 DISPLAYSTRINGDX 02 00FFFADF   DISPNYB 02 00FFF3B5  DISPNYB1 02 00FFF3C3
 DISPWORDASHEX 02 00FFF394    DLY3S1 02 00FFF15E    DLY3S2 02 00FFF162 DRAM_BASE 00 10000000
    DSPJ1B 02 00FFF358    DSRETB 02 00FFF360  DUMPREGS 02 00FFFB9A    DUMRTS 02 00FFF022
 FIRST_CORE 00 00000001   FREEMBX 02 00000002   FREEMSG 02 00000006   FREETCB 00 0000078A
 GETHEXNUMBER 02 00FFFA73  GETRANGE 02 00FFFA5A GETSCREENLOCATION 02 00FFF230 GETTWOPARAMS 02 00FFFA41
      GSL1 02 00FFF23D     GTDC3 02 00FFFAD2     GTHX3 02 00FFFAC4     GTHX5 02 00FFFAAA
     GTHX6 02 00FFFAB7    GTHXN1 02 00FFFA9B    GTHXN2 02 00FFFA7E       HC1 02 00FFF256
   HELPMSG 02 00FFFAEF      HEX2 02 00FFD2CE      HEX4 02 00FFD2D2 HOMECURSOR 02 00FFF241
 HOMECURSORJMP 02 00FFD308      ICC1 02 00FFF350      ICC2 02 00FFF352      ICR1 02 00FFF342
 IGNBLANKS 02 00FFFA38 IGNBLANKS1 02 00FFFA38 INCCURSORPOS 02 00FFF331 INCCURSORROW 02 00FFF340
      INCH 02 00FFF95E     INCHE 02 00FFF963    INCHEK 02 00FFF967   INCHEK1 02 00FFF97B
   INCHEK2 02 00FFF979   INCHEK3 02 00FFF970      INIT 02 00FFF072 IOFOCUSID 00 00000100
 IOFOCUSNDX 00 00000100   IRQBASE 00 000000DF   IRQFLAG 00 000007C6 IRQSOURCE 00 0000079A
  IRQ_ROUT 02 00FFFC76  JTC_EXIT 02 00FFFC11 JUMP_TO_CODE 02 00FFFBDE  KBDI0002 02 00FFF7C5
  KBDI0004 02 00FFF80A KBDITRYAGAIN 02 00FFF7FE     KBGS1 02 00FFF778     KBGS2 02 00FFF770
     KBGS3 02 00FFF761     KEYBD 00 FFE30400  KEYBDACK 00 FFFFCC00  KEYBDBAD 00 FFFFCB00
 KEYBDBUFFER 00 FFFFC000 KEYBDCHECKFORKEYDIRECT 02 00FFF95C KEYBDCLOSE 02 00FFF958  KEYBDCLR 00 FFE30402
 KEYBDCONTROLCODES 02 00FFF600 KEYBDECHO 00 FFFFCA00 KEYBDEXTENDEDCODES 02 00FFF680 KEYBDGETID 02 00FFF79C
 KEYBDGETSCANCODE 02 00FFF77D KEYBDGETSTATUS 02 00FFF761 KEYBDHEAD 00 FFFFC800   KEYBDID 00 00000124
 KEYBDINIT 02 00FFF7C0 KEYBDLOCKS 00 FFFFCD00 KEYBDOPEN 02 00FFF957 KEYBDREAD 02 00FFF959
 KEYBDRECVBYTE 02 00FFF700 KEYBDSEEK 02 00FFF95B KEYBDSENDBYTE 02 00FFF719 KEYBDSETLED 02 00FFF789
 KEYBDTAIL 00 FFFFC900 KEYBDWAITTX 02 00FFF71F KEYBDWRITE 02 00FFF95A    KEYLED 00 00000122
 KEYSTATE1 00 00000120 KEYSTATE2 00 00000121     KGID1 02 00FFF7B9  KGNOTKBD 02 00FFF7BC
      KRB3 02 00FFF705      KRB4 02 00FFF715      KWT1 02 00FFF724      KWT2 02 00FFF735
      LEDS 00 FFE60000    LEDXIT 02 00FFF81E    LETTER 02 00FFD2C1        LF 00 0000000A
 MAX_TASKNO 00 0000003F  MONGETCH 02 00FFFA28 MONGETNONSPACE 02 00FFFA2D   MONITOR 02 00FFF996
 MONITORSTART 02 00FFF991 MON_CCRSAVE 00 0000090F MON_DPRSAVE 00 0000090E MON_DSAVE 00 00000900
 MON_NUMWKA 00 00000910 MON_PCSAVE 00 0000090A    MON_R1 00 00000920    MON_R2 00 00000922
 MON_SSAVE 00 00000908 MON_USAVE 00 00000906 MON_XSAVE 00 00000902 MON_YSAVE 00 00000904
   MSCOUNT 00 FFFFFFE4 MSGBADKEYBD 02 00FFF82A    MSGERR 02 00FFFAE7 MSGREGHEADINGS 02 00FFFB64
 MSGSTARTUP 02 00FFF0BF MULTI_SIEVE 02 00FFF0F6 MULTI_SIEVE1 02 00FFF119 MULTI_SIEVE2 02 00FFF115
 MULTI_SIEVE3 02 00FFF103 MULTI_SIEVE4 02 00FFF12C     NHEX4 02 00FFFB92  NMAILBOX 02 00000004
   NMIBASE 00 000000DC  NMI_ROUT 02 00FFFCB8   NMSGBLK 02 00000008   NXBLANK 02 00FFFB96
    ONEKEY 02 00FFD1DC     OUTCH 02 00FFF97C     PCRLF 02 00FFF374     PDATA 02 00FFF381
       PIC 00 FFE3F000    PICPTR 00 00000028     PRINT 02 00FFF37E   PROMPT1 02 00FFF9B1
   PROMPT2 02 00FFF9E5   PROMPT3 02 00FFF9A4   PROMPTC 02 00FFF9F0   PROMPTD 02 00FFF9FB
   PROMPTF 02 00FFFA07   PROMPTJ 02 00FFFA1A  PROMPTLN 02 00FFF99D   PROMPTR 02 00FFFA1F
    PSTRNG 02 00FFF370     QNDX0 00 00000780     QNDX1 00 00000782     QNDX2 00 00000784
     QNDX3 00 00000786     QNDX4 00 00000788    RAMERR 02 00FFE02C   RAMTEST 02 00FFE000
  RAMTEST1 02 00FFE00D  RAMTEST3 02 00FFE017  ROMTORAM 02 00FFF0E6 ROMTORAM1 02 00FFF0EC
 RUNNINGID 00 00800000 RUNNINGTCB 06 00000000 SCREENCOLOR 00 00000113 SCREENLOCATION 00 00000010
 SCREENLOCATION2 00 00000018  SCROLLUP 02 00FFF1FB    SCRUP1 02 00FFF208    SC_ALT 00 00000011
      SC_C 00 00000021 SC_CAPSLOCK 00 00000058   SC_CTRL 00 00000014    SC_DEL 00 00000071
 SC_EXTEND 00 000000E0    SC_F12 00 00000007  SC_KEYUP 00 000000F0 SC_NUMLOCK 00 00000077
 SC_RSHIFT 00 00000059 SC_SCROLLLOCK 00 0000007E      SC_T 00 0000002C    SC_TAB 00 0000000D
      SC_Z 00 0000001A SETKEYBOARDECHO 02 00FFF980 SHIFTEDSCANCODES 02 00FFF500 SHIFTLEFT5 02 00FFF16D
 SHL_NUMWKA 02 00FFFA6A SHOWSPRITES 02 00FFF986     SIEVE 02 00FFF130    SIEVE1 02 00FFF148
    SIEVE2 02 00FFF144    SIEVE3 02 00FFF135    SIEVE4 02 00FFF157 SKIP_INIT 02 00FFF08C
 SPRITE_CTRL 00 FFE10000 SPRITE_EN 00 000003C0       ST1 02 00FFF079       ST3 02 00FFF069
       ST6 02 00FFF030       ST7 02 00FFF03A       ST8 02 00FFF03A     START 02 00FFF023
    STRPTR 00 00000024 SWI3_EXIT 02 00FFFC51 SWI3_ROUT 02 00FFFC2B       TAB 00 00000009
 TCB_CURSORCOL 00 00000021 TCB_CURSORROW 00 00000020  TCB_HJCB 00 0000001C TCB_HWAITMBX 00 00000022
 TCB_IOF_NEXT 00 0000002C TCB_IOF_PREV 00 00000030 TCB_MBQ_NEXT 00 00000024 TCB_MBQ_PREV 00 00000028
 TCB_MMU_MAP 00 00000038 TCB_MSGPTR_D1 00 00000014 TCB_MSGPTR_D2 00 00000018 TCB_NXTRDY 00 00000000
 TCB_NXTTCB 00 00000008 TCB_PRIORITY 00 00000010 TCB_PRVRDY 00 00000004 TCB_SPSAVE 00 00000034
 TCB_STATUS 00 0000001E TCB_TIMEOUT 00 0000000C TEXTCLOSE 02 00FFF1CC  TEXTOPEN 02 00FFF1CB
  TEXTREAD 02 00FFF1CD   TEXTREG 00 FFE0DF00   TEXTSCR 00 FFE00000  TEXTSEEK 02 00FFF1CF
 TEXTWRITE 02 00FFF1CE TEXT_COLS 00 00000000 TEXT_CURPOS 00 00000022 TEXT_ROWS 00 00000001
 TIMEOUTLIST 00 0000078C      TR1A 02 00FFFCB7      UCP1 02 00FFF277 UNSHIFTEDSCANCODES 02 00FFF400
 UPDATECURSORPOS 02 00FFF258  W10_0001 02 00FFF740 W300_0001 02 00FFF754  WAIT10MS 02 00FFF739
 WAIT300MS 02 00FFF74D    XBLANK 02 00FFD0AF      XOFF 00 00000013       XON 00 00000011
328 SYMBOLS

0 error(s), 70 warning(s)

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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