This commit is contained in:
2023-05-08 14:10:56 +02:00
parent 00d0cdfaf3
commit 15c3bf45ff
2 changed files with 81 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
.data
txt: .asciiz "anthony Debucquoy"
.text
main:
la $a0, txt
addiu $sp, $sp, -4
sw $ra, 0($sp)
jal strlen
lw $ra, 0($sp)
addiu $sp, $sp, 4
move $a0, $v0
li $v0, 1
syscall
j fctend
strlen:
li $v0, 0
li $t1, 0
strloop:
lb $t0, 0($a0)
beq $t0, $zero, fctend
addiu $a0, $a0, 1
addiu $v0, $v0, 1
j strloop
strcmp:
fctend:
jr $ra