/
/ PDP-11 C.
/ Standard Library.
/
/ Integer to Character (internal).
/
 
	.globl	_itoc
 
/
/ _itoc
/ On entry:
/	r0=number
/	r1=buffer address
/
/ On return:
/	r1=updated
/
 
_itoc:
	mov	r2,-(sp)
	mov	r3,-(sp)
	mov	r0,r2
	bpl	0f
	movb	$'-,(r1)+
	br	1f
0:
	neg	r2
1:
	call	itoc
	mov	(sp)+,r3
	mov	(sp)+,r2
	return
 
itoc:
	ashc	$-16.,r2
	div	$10.,r2
	beq	0f
	mov	r3,-(sp)
	call	itoc
	mov	(sp)+,r3
0:
	neg	r3
	add	$'0,r3
	movb	r3,(r1)+
	return
