1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
konstantin123 [22]
3 years ago
11

Write a program that echos back any inputted integer greater than 1, and exits when a 0 is entered. Your program should use a co

nditional 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.
Computers and Technology
1 answer:
denpristay [2]3 years ago
7 0

Answer:

MIPS Code:

.data

newline: .asciiz "\n" #newline variable

.text

MAINLOOP:

li $v0, 5 #syscall to get user interger and store in $v0

syscall

add $a0, $zero, $v0 #moving the user input to $a0 from $v0

beq $a0, 0, EXIT #branching to EXIT when $a0 is 0

li $v0, 1 #syscall to print integer in $a0

syscall

li $v0, 4 #syscall to print newline

la $a0, newline

syscall

j MAINLOOP #jumping to MAINLOOP

EXIT:

Sample Output:

6

6

7

7

3

3

0

You might be interested in
In 2-3 sentences, explain to another student why shortcuts are beneficial. Include details about shortcuts that you have used.
Kipish [7]

Answer:

Explanation:

Keyboard Shortcut Examples

crtl + esc = open start menu

alt + tab = switch apps

ctrl + z = undo

Shortcuts basically help everything occur in a quicker form . They help make the task easier .

3 0
3 years ago
Read 2 more answers
How does one select an entrepreneurial activity?
dem82 [27]
<span>Entrepreneurial activity is a human action with the goal of the generation of value, through the creation or expansion of economic activity. Several things must be taken into consideration before starting an </span><span>entrepreneurial activity but the most important is :
- the benefits it will give (financial but also personal , will you be satisfied doing that activity and will the activity bring financial benefits to you?
If yes, then you can do this activity.
</span>
6 0
4 years ago
Describe two ways methods that cab be used to help stop hacking
mojhsa [17]

Answer:

Use a firewall

Install antivirus software.

Explanation:

7 0
2 years ago
What are examples of real-time applications
Savatey [412]

Typical examples of real-time systems include Air Traffic Control Systems, Networked Multimedia Systems, Command Control Systems etc.

3 0
4 years ago
3. Program to find the sum of all even numbers from m to n, where m and n
Gnom [1K]

Answer: M and E

Explanation: Hope this helps

8 0
3 years ago
Other questions:
  • Pointers with classes a) A user-defined class named Timer has a constructor that takes two integer parameters to initialize hour
    14·1 answer
  • Write a recursive function, len, that accepts a parameter that holds a string value, and returns the number of characters in the
    7·1 answer
  • Subnetting is accomplished by borrowing bits from the _____ portion of an ip address and reassigning those bits for use as netwo
    13·1 answer
  • java A palindrome is a word or a phrase that is the same when read both forward and backward. Examples are: "bob," "sees," or "n
    5·1 answer
  • Which function of NOS involves swapping programs and files
    6·1 answer
  • What section in an ethernet frame will you find a Virtual Local Area Network (VLAN) header?
    6·1 answer
  • Describing Report Tools Functions
    9·1 answer
  • Who wanna be besties
    8·2 answers
  • It displays the contents of the active cell. It allows you to enter and edit data, such as formulas.
    8·1 answer
  • Write algorithm and flowchart for the following<br>a.find the sum and average of any four numbers ​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!