Explanation of Solution
MIPS instructions:
The MIPS instruction for the given scenario as follows:
#load $t5 = +
conversion: li $t5, 0x2B
#load $t5 = 0
li $t5, 0x30
#load $t5 = 9
li $t5, 0x39
#$v0 = 0
li $v0, 0
#$t0 = $0 + $a0
add $t0, $0, $a0
#load $t1 = $t0
lbu $t1, 0($t0)
#$t3 = $t1 + $0
add $t3, $t1, $0
#$t0 = $t0 + 1
addiu $t0, $t0, 1
#load $t1 = $t0
lbu $t1, 0($t0)
#check char < '0'
Test: slt $t2, $t1, $t6
#if $t0 > $a0, go to noDig
bne $t0, $a0, noDig
#check char < '9'
slt $t2, $t1, $t7
#if $t2 = $0, go to noDig
beq $t2, $0, noDig
#$t1 = $t1 - $t6
subu $t1, $t1, $t6
#$v0 = $v0 * 10
mul $v0, $v0, 10
#$v0 = $v0 + $t1
add $v0, $v0, $t1
#$t0 = $t0 + 1
addiu $t0, $t0, 1
#load $t1 = $t0
lbu $t1, 0($t0)
#if $t1 > $0, go to Test
bne $t1, $0, Test
#if $t3 > $t5, go to Neg
bne &#...
Want to see the full answer?
Check out a sample textbook solutionChapter 2 Solutions
COMPUTER ORGANIZATION+DESIGN >I<
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY