improve printing of BASIC errors.
This commit is contained in:
1 parent
ab81f479a1
commit
c43dbe1c29
4 files changed
+37
-37
No files matched your search
+34
-33
@@ -1,39 +1,40 @@
|
|||||||
;; Compute's Mapping the 64 p93
|
;; Compute's Mapping the 64 p93
|
||||||
|
|
||||||
basic_do_error:
|
basic_do_error:
|
||||||
|
;; Save error number
|
||||||
|
txa
|
||||||
|
pha
|
||||||
|
|
||||||
|
;; Print ? at start
|
||||||
|
lda #$0d
|
||||||
|
jsr $ffd2
|
||||||
|
lda #$3f
|
||||||
|
jsr $ffd2
|
||||||
|
|
||||||
|
;; Print main part of error message
|
||||||
|
pla
|
||||||
|
tax
|
||||||
|
jsr print_packed_message
|
||||||
|
|
||||||
|
;; Print ERROR at end
|
||||||
|
lda #$20
|
||||||
|
jsr $ffd2
|
||||||
|
ldx #33
|
||||||
|
jsr print_packed_message
|
||||||
|
|
||||||
|
;; XXX print IN if not in direct mode
|
||||||
|
|
||||||
|
;; XXX print line number if not in direct mode
|
||||||
|
|
||||||
|
lda #$0d
|
||||||
|
jsr $ffd2
|
||||||
|
lda #$0d
|
||||||
|
jsr $ffd2
|
||||||
|
|
||||||
|
;; Reset stack, and go back to main loop
|
||||||
|
ldx #$fe
|
||||||
|
txs
|
||||||
|
jmp basic_main_loop
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
basic_error_messages:
|
|
||||||
.byte "TOO MANY FILES",0
|
|
||||||
.byte "FILE OPEN",0
|
|
||||||
.byte "FILE NOT OPEN",0
|
|
||||||
.byte "FILE NOT FOUND",0
|
|
||||||
.byte "DEVICE NOT PRESENT",0
|
|
||||||
.byte "NOT INPUT FILE",0
|
|
||||||
.byte "NOT OUTPUT FILE",0
|
|
||||||
.byte "MISSING FILENAME",0
|
|
||||||
.byte "ILLEGAL DEVICE NUMBER",0
|
|
||||||
.byte "NEXT WITHOUT FOR",0
|
|
||||||
.byte "SYNTAX",0
|
|
||||||
.byte "RETURN WITHOUT GOSUB",0
|
|
||||||
.byte "OUT OF DATA",0
|
|
||||||
.byte "ILLEGAL QUANTITY",0
|
|
||||||
.byte "OVERFLOW",0
|
|
||||||
.byte "OUT OF MEMORY",0
|
|
||||||
.byte "UNDEF'D STATEMENT",0
|
|
||||||
.byte "BAD SUBSCRIPT",0
|
|
||||||
.byte "REDIM'D ARRAY",0
|
|
||||||
.byte "DIVISION BY ZERO",0
|
|
||||||
.byte "ILLEGAL DIRECT",0
|
|
||||||
.byte "TYPE MISMATCH",0
|
|
||||||
.byte "STRING TOO LONG",0
|
|
||||||
.byte "FILE DATA",0
|
|
||||||
.byte "FORMULA TOO COMPLEX",0
|
|
||||||
.byte "CAN'T CONTINUE",0
|
|
||||||
.byte "UNDEF'D FUNCTION",0
|
|
||||||
.byte "VERIFY",0
|
|
||||||
.byte "LOAD",0
|
|
||||||
@@ -14,7 +14,7 @@ read_line_loop:
|
|||||||
cpx #80
|
cpx #80
|
||||||
bcc +
|
bcc +
|
||||||
;; Report STRING TOO LONG error (Compute's Mapping the 64 p93)
|
;; Report STRING TOO LONG error (Compute's Mapping the 64 p93)
|
||||||
ldx #23
|
ldx #22
|
||||||
jmp basic_do_error
|
jmp basic_do_error
|
||||||
*
|
*
|
||||||
sta basic_input_buffer,x
|
sta basic_input_buffer,x
|
||||||
|
|||||||
@@ -4,4 +4,3 @@ ready_message:
|
|||||||
ldx #29
|
ldx #29
|
||||||
jmp print_packed_message
|
jmp print_packed_message
|
||||||
|
|
||||||
|
|
||||||
@@ -38,11 +38,11 @@ char *error_list[]={
|
|||||||
"VERIFY",
|
"VERIFY",
|
||||||
"LOAD",
|
"LOAD",
|
||||||
// Non-error messages
|
// Non-error messages
|
||||||
"READY.\r",
|
"READY.\r", // #29
|
||||||
"LOADING",
|
"LOADING",
|
||||||
"VERIFYING",
|
"VERIFYING",
|
||||||
"SAVING",
|
"SAVING",
|
||||||
|
"ERROR", // #33
|
||||||
NULL};
|
NULL};
|
||||||
|
|
||||||
// Token $FF is end of message, so we can have only 255 unique words
|
// Token $FF is end of message, so we can have only 255 unique words
|
||||||
|
|||||||
Reference in new issue
Block a user