; $Id: kprstr.mac 503 2013-04-06 19:44:13Z mueller $ ; Copyright 2013- by Walter F.J. Mueller ; License disclaimer see LICENSE_gpl_v2.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