Prompt:	DC "String length: \0"
STR:	DC "Minas\0"

	addi	sp, x0, 0
	addi	a0, x0, STR
	jal	ra, strlen
	addi	t0, a0, 0
	addi	a0, x0, Prompt
	jal	ra, strlen
	add	a0, t0, a0
	ecall	x0, a0, 0
	ebreak	x0, x0, 0

strlen:
	addi	sp, sp, -16
	sd	t0, 8(sp)
	sd	t1, 0(sp)
	addi	t0, x0, 0		;; t0 = 0
	
loop:	lb	t1, 0(a0)
	beq	t1, x0, ENDstrlen
	addi	t0, t0, 1		;; t0++
	addi	a0, a0, 1		;; a0++
	beq	x0, x0, loop

ENDstrlen:
	addi	a0, t0, 0
	ld	t0, 8(sp)
	ld	t1, 0(sp)
	addi	sp, sp, 16
	jalr	x0, 0(ra)
