/
/ Radix 50 to ASCII.
/

	.globl	r50toa

/
/ Table indexed by character to get ascii
/ code.
/

t:	.ascii	" abcdefghijklmnopqrs"
	.ascii	"tuvwxyz$.?0123456789"

/
/ r50toa(a, r, n);
/ char *a;
/ int  *r;
/ int   n;
/
/ Convert 'n' words worth of radix 50 characters
/ to ascii.
/

r50toa:	jsr	r0,__csav	/Get new stack frame
	mov	12(r5),r4	/Output pointer
	mov	14(r5),r3	/Input pointer

0:	dec	16(r5)		/Any more words0
	bmi	0f		/No
	mov	(r3)+,r2	/Get input word
	mov	$3100,r1	/First character
	call	1f		/
	movb	t(r0),(r4)+	/
	mov	$50,r1		/Second character
	call	1f		/
	movb	t(r0),(r4)+	/
	movb	t(r2),(r4)+	/Third character
	br	0b

0:	mov	12(r5),r0	/Return
	jmp	__cret		/

/
/ Local divide routine.
/ Must be unsigned.
/ r2=dividend r1=divisor
/ Returns: r0=quotient r2=remainder
/

1:	clr	r0		/Q = 0

0:	cmp	r2,r1		/Divide the long way
	blo	0f		/
	sub	r1,r2		/
	inc	r0		/
	br	0b		/

0:	return			/Done
