Skip to content

Instantly share code, notes, and snippets.

@kuninet
Last active August 20, 2018 14:18
Show Gist options
  • Save kuninet/6956e3ec7e1a8d873dc4ca1a86b2de21 to your computer and use it in GitHub Desktop.
Save kuninet/6956e3ec7e1a8d873dc4ca1a86b2de21 to your computer and use it in GitHub Desktop.
LILBUG BANK MEM CHANGE USER COMMAND
; BANK Change LILBUG USER COMMAND - 1Mbit EXTENDED MEMORY
; TARGET: LILBUG ON SBC6303 + 1Mbit RAM
; ASSEMBLER: The Macroassembler AS
;
; SYSTEM DEFINITION
DDR1 EQU $00 ;PORT1 DIRECTION
DDR2 EQU $01 ;PORT2 DIRECTION
PORT1 EQU $02 ;PORT1 I/O
PORT2 EQU $03 ;PORT2 I/O
;
; LILBUG INTERNAL ROUTINE
;
INCH EQU $F806
OUTCH EQU $F809
PCRLF EQU $F818
OUT2H EQU $FAE1
PDATA1 EQU $F80C
PDATA EQU $F80F
ENTRY EQU $F90D
;
; MONITOR RAM LOC
;
FCTPTR EQU $0FA
IOPTR EQU $0FC
;
; IO TABLE
CI EQU $F85B
;
ORG $80
; RAM WORK
BANKNO RMB 1
;
ORG $0B000
START EQU *
;
; BANK MEM INIT
;
LDAA #$FF ;PORT1 OUTPUT
STAA DDR1
LDAA #$1
JSR BANKCHG
;
LDX #TABLE ; USER COMMAND TABLE ADD
STX FCTPTR
LDX #CI
STX IOPTR
;
JMP ENTRY ; GOTO LILBUG
;
; COMMAND TABLE
;
TABLE EQU *
FCB 4
FCC "K"
FDB BANK
;
FCB -1
;
BANK EQU *
JSR INCH
CMPA #$0D
BEQ DISP
CMPA #'0'
BMI ERROR
CMPA #'9'
BLE CNV
;
ERROR LDAA #$FF
RTS
;
CNV EQU *
ANDA #$F
JSR BANKCHG
;
DISP EQU *
JSR PCRLF
LDX #BANKM
JSR PDATA
LDX #BANKNO
JSR OUT2H
JSR PCRLF
;
CLRA ; NORMAL CODE
RTS
;
BANKCHG EQU *
STAA BANKNO
STAA PORT1
RTS
;
BANKM FCC "BANK:"
FCB 4
;
END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment