Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

. 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
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Instant Reference

Authors: Gruber, Martin Gruber

2nd Edition

0782125395, 9780782125399

More Books

Students also viewed these Databases questions

Question

describe the two basic forms of functional social support;

Answered: 1 week ago