If you're comfortable in the land of NMOS, you can try this at only 29 bytes (untested):
Code:
DPL = $fd
DPH = $fe
primm:
pla ; get low part of (string address-1)
tay
pla ; get high part of (string address-1)
sta DPH
lda #0
sta DPL
beq primm3
primm2:
jsr COUT ; output a string char
primm3:
iny ; advance the string pointer
bne primm4
inc DPH
primm4:
lda (DPL),y ; get string char
bne primm2 ; output and continue if not NUL
lda DPH
pha
tya
pha
rts ; proceed at code following the NUL
If I didn't mess something up, this should work all the way back to an original Apple 1.
Edit: If you don't mind trashing A X and Y, then here's some (untested) CMOS in only 24 bytes:
Code:
DPL = $fd
DPH = $fe
primm:
ply ; get low part of (string address-1)
stz DPL
plx ; get high part of (string address-1)
stx DPH
bra primm3
primm2:
jsr COUT ; output a string char
primm3:
iny ; advance the string pointer
bne primm4
inc DPH
inx
primm4:
lda (DPL),y ; get string char
bne primm2 ; output and continue if not NUL
phx
phy
rts ; proceed at code following the NUL
_________________
Got a kilobyte lying fallow in your 65xx's memory map? Sprinkle some
VTL02C on it and see how it grows on you!
Mike B.
(about me) (learning how to github)