	.section	.text
	.global	zstr_cat
zstr_cat:
	stmdb	sp!, {r0, r1, lr}	@ Preserve link register for function call
	bl	zstr_len
	ldm	sp!, {r1, r2}
	mov	r3, r1			@ pointer = destination
	add	r0, r0, r1		@ destination = destination + length
	ldrb	r1, [r2]
	strb	r1, [r0]		@ *destination = *source
	b	zstr_cat.loop
zstr_cat.copy:
	add	r0, r0, #1		@ destination = destination + 1
	add	r2, r2, #1		@ source = source + 1
	ldrb	r1, [r2]
	strb	r1, [r0]		@ *destination = *source
zstr_cat.loop:
	ldrb	r1, [r2]
	cmp	r1, #0
	bne	zstr_cat.copy		@ *source <> 0
	sub	r0, r0, r3		@ compute and return length
	ldr	pc, [sp], #4		@ Restore lr in pc
