Question: . data str: . asciiz # str = 1 0 space characters . text main: li $a 0 , 5 1 2 8

.data
str: .asciiz "" # str =10 space characters
.text
main:
li $a0,5128,#$a0= unsigned integer to convert
la $ve, str # load address of str into $v0
addiu $v0,$v0,11,#$v0= pointer at end of str
li $a1,10, # Initialize $a1=10
int2str:
divu $a0, $a1 # divide $a0 by 10
mflo$a0,#$a0= quotient
mfhi $t0 # $t0= remainder (0 to 9)
addiu $t0, $t0,48
addiu $v0, $ve,-1
sb $t0,($v0)
# convert digit into a character
# point to previous space character
# store byte: Memory($v0)= $t0
# loop back if quotient is not zero
done:
# $ve = pointer to string in memory
6.6 In-Lab Tasks
Write MIPS code to perform the following integer multiplications. What is the value of the LO
and HI registers?
a)9876554321 using the multu instruction
b)-98765-54321 using the mult instruction
 .data str: .asciiz "" # str =10 space characters .text main:

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!