Full BASIC support
This commit is contained in:
parent
9e7042f604
commit
8034e97620
14
README.md
14
README.md
|
@ -1,7 +1,8 @@
|
|||
# Loomcom 6502 ROM Monitor
|
||||
|
||||
**Version:** 0.1-alpha
|
||||
**Last Updated:** July 1, 2014
|
||||
**Version:** 1.0
|
||||
|
||||
**Last Updated:** July 27, 2014
|
||||
|
||||
## 1.0 About
|
||||
|
||||
|
@ -16,9 +17,6 @@ type `make`!
|
|||
|
||||
## 3.0 To Do
|
||||
|
||||
- Implement 'Q' command that will jump to a pre-defined QUIT
|
||||
routine, e.g. to jump back to BASIC from the monitor.
|
||||
|
||||
- Enhance the 'E' and 'D' commands to take '/' as the first
|
||||
argument, which will automatically increment the previously
|
||||
used Examine or Deposit address. e.g.:
|
||||
|
@ -34,3 +32,9 @@ type `make`!
|
|||
This project is free software. It is distributed under the MIT
|
||||
License. Please see the file 'COPYING' for full details of the
|
||||
license.
|
||||
|
||||
## 5.0 Acknowledgements
|
||||
|
||||
Enhanced 6502 BASIC (EhBASIC, contained entirely in the file
|
||||
"basic.asm") is Version 2.22, and is copyright (c) Lee Davison.
|
||||
It is distributed for non-commercial use only!
|
||||
|
|
32
monitor.asm
32
monitor.asm
|
@ -107,7 +107,7 @@
|
|||
;;; Main ROM Entry Point
|
||||
;;; ----------------------------------------------------------------------
|
||||
|
||||
START: CLI
|
||||
MSTART: CLI
|
||||
CLD
|
||||
LDX #$FF ; Init stack pointer to $FF
|
||||
TXS
|
||||
|
@ -138,8 +138,15 @@ VECS: LDA LABVEC-1,Y
|
|||
DEY
|
||||
BNE VECS
|
||||
|
||||
;; Now jump to BASIC
|
||||
JMP LAB_COLD
|
||||
|
||||
;;; ----------------------------------------------------------------------
|
||||
;;; Welcome the User to the Monitor
|
||||
;;; ----------------------------------------------------------------------
|
||||
|
||||
;; Start the monitor by printing a welcome message.
|
||||
STR BANNR
|
||||
WELCM: STR BANNR
|
||||
|
||||
;;; ----------------------------------------------------------------------
|
||||
;;; Main Eval Loop - Get input, act on it, and return here.
|
||||
|
@ -163,7 +170,8 @@ EVLOOP: CRLF
|
|||
;; input buffer, and then echoed to the screen.
|
||||
;;
|
||||
;; This routine uses Y as the IBUF pointer.
|
||||
NXTCHR: JSR CIN ; Get a character.
|
||||
NXTCHR: JSR CIN ; Get a character, blocking until Carry
|
||||
BCC NXTCHR ; is set.
|
||||
BEQ BSPACE
|
||||
CMP #CR ; Is it a carriage-return?
|
||||
BEQ PARSE ; Done. Parse buffer.
|
||||
|
@ -329,6 +337,8 @@ EXEC: LDX #$00 ; Reset X
|
|||
; with it.
|
||||
CMP #'H' ; Help requires no arguments,
|
||||
BEQ HELP ; so comes first.
|
||||
CMP #'Q' ; 'Quit' just jumps to BASIC warm
|
||||
BEQ QUIT ; start
|
||||
|
||||
LDA TKCNT ; Now we check operand count.
|
||||
BEQ @err ; No operands? Error.
|
||||
|
@ -353,6 +363,9 @@ EXEC: LDX #$00 ; Reset X
|
|||
HELP: STR HELPS
|
||||
JMP EVLOOP
|
||||
|
||||
;;; QUIT command
|
||||
QUIT: JMP LAB_1274 ; BASIC Warm Start.
|
||||
|
||||
;;; GO command
|
||||
GO: JMP (OPBASE) ; Just jump to the appropriate address
|
||||
|
||||
|
@ -617,9 +630,12 @@ COUT: PHA ; Save accumulator
|
|||
;;; Read a character from the ACIA and put it into the accumulator
|
||||
;;; ----------------------------------------------------------------------
|
||||
|
||||
;; Rather ugly, but Enhanced BASIC requires this subroutine to
|
||||
;; return immediately rather than block polling for data, so...
|
||||
|
||||
CIN: LDA IOST
|
||||
AND #$08 ; Is RX register full?
|
||||
BEQ CIN ; No, wait for it to fill up.
|
||||
BEQ @nochr ; No, wait for it to fill up.
|
||||
LDA IORW ; Yes, load character.
|
||||
;;
|
||||
;; If the char is 'a' to 'z', inclusive, mask to upper case.
|
||||
|
@ -631,6 +647,8 @@ CIN: LDA IOST
|
|||
AND #$5f ; No, convert lower case -> upper case,
|
||||
@done: SEC ; Flag byte received, for BASIC
|
||||
RTS ; and return.
|
||||
@nochr: CLC
|
||||
RTS
|
||||
|
||||
;;; ----------------------------------------------------------------------
|
||||
;;; Print the null-terminated string located at STRLO,STRHI
|
||||
|
@ -672,6 +690,6 @@ HELPS: .byte "COMMANDS ARE:",CR,LF
|
|||
.segment "VECTORS"
|
||||
|
||||
.org $FFFA
|
||||
.word START ; NMI vector
|
||||
.word START ; Reset vector
|
||||
.word START ; IRQ vector
|
||||
.word MSTART ; NMI vector
|
||||
.word MSTART ; Reset vector
|
||||
.word MSTART ; IRQ vector
|
||||
|
|
Loading…
Reference in New Issue