Skip to content
Snippets Groups Projects
Commit 3ede4521 authored by ACIKBAS TUNA's avatar ACIKBAS TUNA
Browse files

solution for pow ra_switch

parent 2d8b2435
No related merge requests found
......@@ -19,25 +19,38 @@ continue:
cell_lecture_bit:
#the function cell_lecture_bit takes an int coded on 32 bytes,
li $t0, 31
sub $a1, $t0, $a1 # modify the value to get a shift of 31 -I digits
sllv $a0, $a0,$a1
srl $a0, $a0,31
jr $ra
li $v0, 1
jal pow
move $t0 $t3
sub_pow_10: #sub function used to init pow_10
li $a1,1
j pow_10
pow_10: #function to get the 10**n for a given n
#prolog
#mettre l'addresse de Ra dans la pile sp
beq $a0,$zero,continue ##rename for loop later in the code
li $a2, 10
mul $a1, $a1,$a2
mul $v1, $v1,$a2
addi $a0,$a0,-1
b pow_10
continue:
#epilogue
#recup raa de sp
#move ra_sp dans dans ra
jr $ra
Exit:
li $v0, 10
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment