This commit is contained in:
Debucquoy Anthony 2023-05-08 14:10:56 +02:00
parent 00d0cdfaf3
commit 15c3bf45ff
Signed by: tonitch
GPG Key ID: A78D6421F083D42E
2 changed files with 81 additions and 0 deletions

View File

@ -0,0 +1,44 @@
.text
main:
# 6! = 720
li $a0, 1
li $a1, 2
li $a2, 3
li $a3, 4
li $t0, 5
li $t1, 6
addiu $sp, $sp, -12 # Allocate 3 word (2 args + ra)
sw $ra, 8($sp)
sw $t1, 4($sp)
sw $t0, 0($sp)
jal fct6
lw $ra, 8($sp)
addiu $sp, $sp, 12
move $a0, $v0
li $v0, 1
syscall
jr $ra
fct6:
lw $t0, 0($sp)
lw $t1, 4($sp)
mult $a0, $a1
mflo $v0
mult $v0, $a2
mflo $v0
mult $v0, $a3
mflo $v0
mult $v0, $t0
mflo $v0
mult $v0, $t1
mflo $v0
jr $ra

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