Question

READ CAREFULLY: ONLY .ASM (aka Microsoft VISUAL STUDIO) DO NOT ATTEMP TO USE WRONG FORMAT SUCH...

READ CAREFULLY: ONLY .ASM (aka Microsoft VISUAL STUDIO) DO NOT ATTEMP TO USE WRONG FORMAT SUCH AS NASM

I DO NOT NEED GLOBAL_START ETC.....

SAMPLE FORMAT BASED ON IRVINE TEXTBOOK

.data

.code

iplement the following expression in assembly language:

            for (i = 5; i > 0; i--)

     {

                               for(j = 3; j > 0; j--)  

                                        {

y = i + j ;

          }

      }

  • Assume I and j are 32-bit registers and y is a list.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer:

#MIPS code

move i,6 #initialise i

move j,4   #initialise j

outer_for_loop:

add i.i,-1   # Decrement i

bgt i,0,inner_for_loop

end

inner_for_loop:

add j, j, -1   # Decrement j

bgt j,0,next

j outer_for_loop

next:

add y,i,j   # y = i + j

j inner_for_loop

Add a comment
Know the answer?
Add Answer to:
READ CAREFULLY: ONLY .ASM (aka Microsoft VISUAL STUDIO) DO NOT ATTEMP TO USE WRONG FORMAT SUCH...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • So I am creating a 10 question quiz in Microsoft Visual Studio 2017 (C#) and I...

    So I am creating a 10 question quiz in Microsoft Visual Studio 2017 (C#) and I need help editing my code. I want my quiz to clear the screen after each question. It should do one question at a time and then give a retry of each question that was wrong. The right answer should appear if the retry is wrong. After the 1 retry of each question, a grade should appear. Please note and explain the changes you make...

  • If you’re using Visual Studio Community 2015, as requested, the instructions below should be exact but...

    If you’re using Visual Studio Community 2015, as requested, the instructions below should be exact but minor discrepancies may require you to adjust. If you are attempting this assignment using another version of Visual Studio, you can expect differences in the look, feel, and/or step-by-step instructions below and you’ll have to determine the equivalent actions or operations for your version on your own. INTRODUCTION: In this assignment, you will develop some of the logic for, and then work with, the...

  • I NEED HELP WITH DEBUGGING A C PROGRAM! PLEASE HEAR ME OUT AND READ THIS. I...

    I NEED HELP WITH DEBUGGING A C PROGRAM! PLEASE HEAR ME OUT AND READ THIS. I just have to explain a lot so you understand how the program should work. In C programming, write a simple program to take a text file as input and encrypt/decrypt it by reading the text bit by bit, and swap the bits if it is specified by the first line of the text file to do so (will explain below, and please let me...

  • I am in desperate need of help with this project. Apparently my answers are all wrong....

    I am in desperate need of help with this project. Apparently my answers are all wrong. 3:02 PM Thu Feb 27 4796% AC 321 Intl - FA19 - Comprehensive Project Insert Draw Formulas Data Review View 8 Q o Calibri (Body) 12 B U Home B ^ A = 1 EE tx ã į 19 2 3 4 All work must be completed using this Excel spreadsheet. All journal extries, financial statements, etc. must be prepared in clean, proper form....

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT