diff --git a/c64/basic/basic_do_error.s b/c64/basic/basic_do_error.s index bd06ab29..584bfe19 100644 --- a/c64/basic/basic_do_error.s +++ b/c64/basic/basic_do_error.s @@ -1,39 +1,40 @@ ;; Compute's Mapping the 64 p93 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 diff --git a/c64/basic/basic_main_loop.s b/c64/basic/basic_main_loop.s index e8d2f0ef..636910c7 100644 --- a/c64/basic/basic_main_loop.s +++ b/c64/basic/basic_main_loop.s @@ -14,7 +14,7 @@ read_line_loop: cpx #80 bcc + ;; Report STRING TOO LONG error (Compute's Mapping the 64 p93) - ldx #23 + ldx #22 jmp basic_do_error * sta basic_input_buffer,x diff --git a/c64/basic/ready_message.s b/c64/basic/ready_message.s index 87c55c27..87508bd6 100644 --- a/c64/basic/ready_message.s +++ b/c64/basic/ready_message.s @@ -3,5 +3,4 @@ ready_message: ;; information. ldx #29 jmp print_packed_message - diff --git a/src/make_error_tables.c b/src/make_error_tables.c index d86e38f6..bca9f0dd 100644 --- a/src/make_error_tables.c +++ b/src/make_error_tables.c @@ -38,11 +38,11 @@ char *error_list[]={ "VERIFY", "LOAD", // Non-error messages - "READY.\r", + "READY.\r", // #29 "LOADING", "VERIFYING", "SAVING", - + "ERROR", // #33 NULL}; // Token $FF is end of message, so we can have only 255 unique words