Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
2b23ebf562 | |||
15c3bf45ff |
44
q2/fonctio/tp2/spim-mul6.s
Normal file
44
q2/fonctio/tp2/spim-mul6.s
Normal 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
|
37
q2/fonctio/tp2/spim-strlen-strcomp.s
Normal file
37
q2/fonctio/tp2/spim-strlen-strcomp.s
Normal 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
|
BIN
q2/fonctio/tp4/fonct-ordis-tp4-floating-point.pdf
Normal file
BIN
q2/fonctio/tp4/fonct-ordis-tp4-floating-point.pdf
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user