PRINT can now print strings
This commit is contained in:
1 parent
48eec7d56e
commit
153b34a58a
4 files changed
+49
-17
No files matched your search
@@ -65,7 +65,7 @@ cmd_load_no_error:
|
||||
// For VERIFY - this is it
|
||||
|
||||
lda VERCKB
|
||||
bne cmd_load_end
|
||||
bne_16 basic_execute_statement
|
||||
|
||||
// C64 BASIC apparently does not clear variables after a LOAD in the
|
||||
// middle of a program. For safety, we do.
|
||||
|
||||
@@ -11,6 +11,7 @@ cmd_print:
|
||||
jsr end_of_statement_check
|
||||
bcs cmd_print_new_line
|
||||
|
||||
jsr fetch_character
|
||||
cmp #$3B // semicolon
|
||||
beq cmd_print_done
|
||||
|
||||
@@ -45,7 +46,7 @@ cmd_print_string:
|
||||
cmd_print_float:
|
||||
|
||||
// XXX probably we should also check INTFLG here
|
||||
// XXX
|
||||
// XXX provide implementation
|
||||
|
||||
// FALLTROUGH
|
||||
|
||||
@@ -74,4 +75,4 @@ cmd_print_new_line:
|
||||
|
||||
cmd_print_done:
|
||||
|
||||
jmp basic_main_loop
|
||||
jmp basic_execute_statement
|
||||
@@ -36,4 +36,4 @@ cmd_save:
|
||||
|
||||
// The end
|
||||
|
||||
jmp basic_main_loop
|
||||
jmp basic_execute_statement
|
||||
@@ -19,22 +19,53 @@
|
||||
|
||||
FRMEVL:
|
||||
|
||||
// XXX for now we just report dummy string
|
||||
// Check if end of statement
|
||||
|
||||
lda #$FF
|
||||
sta VALTYP
|
||||
jsr end_of_statement_check
|
||||
bcs_16 do_SYNTAX_error
|
||||
|
||||
lda #$0B
|
||||
sta __FAC1 + 0
|
||||
// Search for opening quote
|
||||
|
||||
lda #<dummy_text
|
||||
sta __FAC1 + 1
|
||||
jsr fetch_character
|
||||
cmp #$22
|
||||
bne FRMEVL_fetch_float
|
||||
|
||||
lda #>dummy_text
|
||||
sta __FAC1 + 2
|
||||
// FALLTROUGH
|
||||
|
||||
FRMEVL_fetch_string:
|
||||
|
||||
// Mark return value as a string, set initial length as 0
|
||||
|
||||
ldx #$FF
|
||||
stx VALTYP
|
||||
|
||||
inx
|
||||
stx __FAC1 + 0
|
||||
|
||||
// Set pointer to start of the string
|
||||
|
||||
ldx TXTPTR + 0
|
||||
stx __FAC1 + 1
|
||||
ldx TXTPTR + 1
|
||||
stx __FAC1 + 2
|
||||
!:
|
||||
// Search for closing quote
|
||||
|
||||
jsr fetch_character
|
||||
cmp #$22
|
||||
beq FRMEVL_done
|
||||
|
||||
inc __FAC1 + 0
|
||||
bne !-
|
||||
|
||||
jmp do_STRING_TOO_LONG_error
|
||||
|
||||
FRMEVL_fetch_float:
|
||||
|
||||
// XXX implement this
|
||||
|
||||
jmp do_SYNTAX_error
|
||||
|
||||
FRMEVL_done:
|
||||
|
||||
rts
|
||||
|
||||
dummy_text:
|
||||
|
||||
.text "LOREM IPSUM"
|
||||
Reference in new issue
Block a user