; $Id: kprstr.mac 830 2016-12-26 20:25:49Z mueller $
; Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
; License disclaimer see License.txt in $RETROBASE directory
;
; synchronous (polling) console print: print 0-terminated string
; Call:
;   jsr  pc, kprstr
; Arguments:
;   r0: pointer to 0-terminated string
; 
; r1-r5 registers preserved
;  

kprstr: mov     r1,-(sp)        ; save r1
        mov     r0,r1           ; r1 now ptr to string
1$:     movb    (r1)+,r0        ; get next char
        beq     2$              ; quit if 0 char
        jsr     pc,kprchr       ; otherwise print char
        br      1$              ; go for next char
2$:     mov     (sp)+,r1        ; restore r1
        rts     pc
