	.section	.text
	.global	str_catz
str_catz:
	mov	r3, r0			@ pointer = destination
	sub	r2, r0, #4
	ldr	r2, [r2]
	add	r0, r0, r2		@ destination = destination + length
	ldrb	r2, [r1]
	strb	r2, [r0]		@ *destination = *string
	b	str_catz.loop
str_catz.copy:
	add	r0, r0, #1		@ destination = destination + 1
	add	r1, r1, #1		@ source = source + 1
	ldrb	r2, [r1]
	strb	r2, [r0]		@ *destination = *source
str_catz.loop:
	ldrb	r2, [r1]
	cmp	r2, #0
	bne	str_catz.copy
	sub	r0, r0, r3		@ calculate and return length
	sub	r1, r3, #4
	str	r0, [r1]		@ set length of destination
	mov	pc, lr
