Yes, as noted, there are other ways to send text strings. Nice approach BTW... I've used the high-bit set method before, back in the C64 days, as was common with much of that coding.
The CHROUT routine (the BIOS call) doesn't disturb any registers:
Code:
;Data Output A routine: puts the data in the A Reg into the xmit buffer, data in
; A Reg is preserved on exit. Transmit is IRQ driven/buffered with a size of 128 bytes.
;
CHROUT PHY ;Save Y Reg (3)
OUTCH LDY OCNT_A ;Get data output count in buffer (3)
BMI OUTCH ;Check against limit, loop back if full (2/3)
;
LDY OTAIL_A ;Get the buffer tail pointer (3)
STA OBUF_A,Y ;Place data in the buffer (5)
INC OTAIL_A ;Increment Tail pointer (5)
RMB7 OTAIL_A ;Strip off bit 7, 128 bytes only (5)
INC OCNT_A ;Increment data count (5)
;
LDY #%00000100 ;Get mask for xmit on (2)
STY UART_COMMAND_A ;Turn on xmit (4)
;
PLY ;Restore Y Reg (4)
RTS ;Return to caller (6)
;
However, I do have a large number of messages in my Monitor code, 74 messages, with a total of 1380 bytes, plus another 148 bytes for the message table. The largest message is 449 bytes in size, as it's the result of the Query command, which displays all of the commands in a single text string.
Code:
MSG_49 .DB $0D,$0A
.DB "Memory Ops: "
.DB "[C]ompare, "
.DB "[D]isplay, "
.DB "[E]dit, "
.DB "[F]ill, "
.DB "[G]o Exec,",$0D,$0A
.DB "[H]ex Find, "
.DB "[I]nput Text, "
.DB "[M]ove, "
.DB "[T]ext Find",$0D,$0A,$0A
.DB "Register Ops: "
.DB "R,A,X,Y,S,P",$0D,$0A,$0A
.DB "Counter/Timer Ops: "
.DB ",= set ms|mult, "
.DB ".= exe ms, "
.DB "/= exe ms*mult",$0D,$0A
.DB "[B]enchmark clear/start, "
.DB "[Q]uit benchmark/display elapsed time",$0D,$0A,$0A
.DB "Macro: "
.DB "(= Init "
.DB ")= Run",$0D,$0A,$0A
.DB "CTRL[?]: "
.DB "[A]ssemble, "
.DB "[B]oot DOS/65, "
.DB "[D]isassemble, "
.DB "[E]dit EEPROM, "
.DB "[L]oad",$0D,$0A
.DB "[P]rogram, "
.DB "[Q]uery Cmds ,"
.DB "[R]eset, "
.DB "[S]ave, "
.DB "[T]ime/Date, "
.DB "[V]ersion",$0D,$0A
.DB "[Z]ero RAM/Reset",$0A
.DB $00
;
Yea, I know.... a large number of messages, but then again, the Monitor has a lot of functions (the Assembler part isn't completed yet) but it still uses just under 5KB of ROM space, from an allocated space of 6KB. The BIOS code and I/O space fit in an allocated space of 2KB and I still have some available space there too.