Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the following MIPS Assembly Language Code (where it is understood that we are dealing with Non-Negative Integers only): a) Briefly explain what this code

Consider the following MIPS Assembly Language Code (where it is understood that we are dealing with Non-Negative Integers only):

image text in transcribed

image text in transcribed

a) Briefly explain what this code does?

b) You are required to convert this code to C/C++ [or a pseudo code clearly describing functionality].

text, globl main. main: subu $sp, sp, 12 Sra, 0 ($sp) SW sso, 4 ($sp) SW $s1, 8 ($sp) SW li $s1 0 read $v0, 4 li Sao, prompt 1a syscall li $v0, 5 syscall move $s0, v0 li $to -1 beq $50, sto, printtot add $s1, $s1, $s0 read print tot: $v0, 4 li 1a $a0, tmsg syscall $v0, 1 li move $a0, sl syscall $v0, 4 li text, globl main. main: subu $sp, sp, 12 Sra, 0 ($sp) SW sso, 4 ($sp) SW $s1, 8 ($sp) SW li $s1 0 read $v0, 4 li Sao, prompt 1a syscall li $v0, 5 syscall move $s0, v0 li $to -1 beq $50, sto, printtot add $s1, $s1, $s0 read print tot: $v0, 4 li 1a $a0, tmsg syscall $v0, 1 li move $a0, sl syscall $v0, 4 li

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

DB2 11 The Ultimate Database For Cloud Analytics And Mobile

Authors: John Campbell, Chris Crone, Gareth Jones, Surekha Parekh, Jay Yothers

1st Edition

1583474013, 978-1583474013

More Books

Students also viewed these Databases questions

Question

Question Can a self-employed person adopt a profit sharing plan?

Answered: 1 week ago