Code: Select all
start_message: .byte "VC83 BASIC "
.include "version.inc"
.byte " <> "
start_length = * - start_message
free_message: .byte " BYTES FREE"
free_length = * - free_message
initialize:
jsr initialize_target
ldax #start_message
ldy #start_length
jsr write
You might find zero-terminated string printing more efficient, saving all those pairs of bytes setting the length of the string. If you put all your internal strings in one block, as long as it is less than 256 bytes long all you need to do is call your message printing routine with the offset to the message. Eg:
message_base:
start_message: .byte "VC83 BASIC ",0
free_message: .byte " BYTES FREE",0
ready_message: .byte "READY",nl,cr.0
abort_message: .byte nl,cr,"ABORT",nl,cr,0
...
ldx #start_message-message_base
jsr message_print
...
ldx #abort_message-message_base
jsr message_print
...
etc.
message_print:
LDA message_base,X:BEQ rts
JSR charout:INX:BNE message_print