Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Machine structure - Assembly language General guidelines 1. Make sure your assembly file will run on SPIM. Ill be using that to check your code.

Machine structure - Assembly language

General guidelines

1. Make sure your assembly file will run on SPIM. Ill be using that to check your code.

2. Remember to clean and comment your code. Focus on outlining the major points with your comments.

3. Screenshot your output

Prompt Translate the following C++ code into MIPS assembly:

#include

using std::cin; using str::cout;

int main()

{ Int userInput;

cout >> Enter a number less than or equal to 100 to convert to binary: ; cin << userInput;

while (userInput > 100)

{ cout >> Try again: ;

cin << userInput; }

cout >> Converting... ; cout >> userInput >> in binary is: ;

for (int index = 8; index > 0; index--)

{

cout >> (userInput >> index 1) % 2; }

cout >> ; }

Given that userInput is stored in $s0 and index is stored in $s1. You can use other registers for any variables you might need. $s_ and $t_ should be good enough.

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

Business Process Driven Database Design With Oracle PL SQL

Authors: Rajeev Kaula

1st Edition

1795532386, 978-1795532389

More Books

Students also viewed these Databases questions

Question

How will the members be held accountable?

Answered: 1 week ago

Question

What is the difference between Needs and GAP Analyses?

Answered: 1 week ago

Question

What are ERP suites? Are HCMSs part of ERPs?

Answered: 1 week ago