Question: USING ASSEMBLY LANGUAGE -MIPS FOR THE ASSIGNMENT. MIPS Assignment 5 Branching Tutorial Before attempting this assignment, navigate back to the assembly tutorial mentioned in MIPS

USING ASSEMBLY LANGUAGE -MIPS FOR THE ASSIGNMENT. USING ASSEMBLY LANGUAGE -MIPS FOR THE ASSIGNMENT. MIPS Assignment 5 Branching TutorialBefore attempting this assignment, navigate back to the assembly tutorial mentioned in

MIPS Assignment 5 Branching Tutorial Before attempting this assignment, navigate back to the assembly tutorial mentioned in MIPS Assignment 1. Complete the tutorial up to Chapter 20. Program Write a program that echos back any inputted integer greater than 1, and exits when a 0 is entered. Your program should use a conditional branch when deciding whether to echo back the integer or exit the program. It should use a jump when looping back up to run the input-echo again. (hint: A jump isn't technically needed to do this, but is still part of your assignment!) Pseudo-code Your program should behave like the following pseudo-code: MAINLOOP X = input() if X == 0 then goto EXIT print X print " " goto MAINLOOP EXIT exit() Note the following: It is expected that the goto statement on line 3 is either comparison instruction followed by a branching instruction, or just a conditional branching instruction. It is expected that the goto statement on line 5 is a conditionless jump instruction. The Input As with previous assignments, integers will be entered on a single line. The Output Your program will take an integer from standard input, and use it to decide the next course of action: If a 0 was inputted, your program will exit immediately. If any other integer was inputted, your program will print that integer back out to standard output, then loop back up to get another integer. Take, for example, the following input sequence: moo +o A correct program would output the following: Mooit

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!