
# StrAdd(r3:PTR TO CHAR,r4:PTR TO CHAR,r5=-1:LONG)

	.text
	.global	_StrAdd

_StrAdd:
	subi	r6,r3,1		# find the end of the destination string
.find:	lbzu	r0,1(r6)
	mr.	r0,r0
	bne	.find

	subi	r4,r4,1
	subi	r6,r6,1
.loop:	lbzu	r0,1(r4)		# get char from source
	stbu	r0,1(r6)		# put char to destination
	mr.	r0,r0		# source end?
	beq	.finish
	subi	r5,r5,1		# length done?
	mr.	r5,r5
	bne	.loop
	li	r0,0		# finish with zero byte
	stb	r0,1(r6)
.finish:	blr			# r3 contains destination string pointer

	.type	_StrAdd,@function
	.size	_StrAdd,$-_StrAdd
