convert the following c code to mips. assume the address of base array is associated with $s0, n is associated with $s1, positio
n is associated with $t0, c is associated with $t1, d is associated with $t2, and swap is associated with $t3 for (c
1 answer:
Answer:
Explanation:
hello we will follow a step by step process for this code, i hope you find it easy.
Mips Equivalent code:
sw $0,0($fp)
.L7:
lw $2,12($fp)
addiu $2,$2,-1
lw $3,0($fp)
slt $2,$3,$2
beq $2,$0,.L2
nop
lw $2,0($fp)
sw $2,8($fp)
lw $2,0($fp)
addiu $2,$2,1
sw $2,4($fp)
.L5:
lw $3,4($fp)
lw $2,12($fp)
slt $2,$3,$2
beq $2,$0,.L3
nop
lw $2,8($fp)
dsll $2,$2,2
daddu $2,$fp,$2
lw $3,24($2)
lw $2,4($fp)
dsll $2,$2,2
daddu $2,$fp,$2
lw $2,24($2)
slt $2,$2,$3
beq $2,$0,.L4
nop
lw $2,4($fp)
sw $2,8($fp)
.L4:
lw $2,4($fp)
addiu $2,$2,1
sw $2,4($fp)
b .L5
nop
.L3:
lw $3,8($fp)
lw $2,0($fp)
beq $3,$2,.L6
nop
lw $2,0($fp)
dsll $2,$2,2
daddu $2,$fp,$2
lw $2,24($2)
sw $2,16($fp)
lw $2,8($fp)
dsll $2,$2,2
daddu $2,$fp,$2
lw $3,24($2)
lw $2,0($fp)
dsll $2,$2,2
daddu $2,$fp,$2
sw $3,24($2)
lw $2,8($fp)
dsll $2,$2,2
daddu $2,$fp,$2
lw $3,16($fp)
sw $3,24($2)
.L6:
lw $2,0($fp)
addiu $2,$2,1
sw $2,0($fp)
b .L7
nop
cheers i hope this helps
You might be interested in
The answer is B.
If you press the tab key when you're in the last cell of a table, you will add a new blank row
Answer:
I would design the word asa better place
Explanation:
Answer:
Pairing and Passkey or PIN
Explanation:
The answer is B. Issue report cards of grades.