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
Is the following statement true or false?
Alchen [17]

Answer:

The following statement is True.

Explanation:

Because when we are applying the pair t-test then, take differences of that pair and then treat it as an individual samples. Formula for the test is a statistic and in this case, it is also same as formula in the one-sample of t statistics.

Therefore, it will be an equivalent to the one-sample t-test.

6 0
3 years ago
Assume that we would like to expand the MIPS register file to 128 and keep the size of all other fields as in the original MPIS
garri49 [273]

Answer:

These changes has the ability to decrease the size of a program, it

can do so by going ahead to reduce the instances in which the register contents “spill” into other registers or memory, it also does so by allowing more complex operations to be implemented in one instruction as agianst requiring multiple instructions.

On the other hand they are likely able to increase the size of a program by requiring adding bits to the opcode and register fields, thereby increasing memory width

Explanation:

See answer

7 0
3 years ago
Read 2 more answers
Design a flowchart or pseudocode for a program that accepts three numbers from a user and displays a message if the sum of any t
Keith_Richards [23]

Answer:

Hi there! Pseudocode is the process of writing out the high-level structure of the program in simple English terms which acts as a blueprint of how the program will work. The pseudocode for this question is written below.

Explanation:

Prompt user for input 1

Validate input 1

Prompt user for input 2

Validate input 2

Prompt user for input 3

Validate input 3

Perform checks:

If  

 1 and 2 equals 3

 Or

 1 and 3 equals 2

 Or

 2 and 3 equals 1

Display message to user

6 0
3 years ago
5 things that i learned about internet safty
Ksenya-84 [330]
1. To not put your real name in a username
2. Don't give people your personal information
3. Tell your parents if someone messages you something and you don't know them
4. make your social media accounts private
5. Ask for a adult for help if you see something that confuses you
7 0
3 years ago
Read 2 more answers
Word Bank:
NNADVOKAT [17]

Explanation:

circle with radius and colour red

3 0
2 years ago
Other questions:
  • To have the most impact when using email, you should structure your messages so that
    5·1 answer
  • Secure Wi-Fi networks and VPNs use _____ to secure data transferred over a network.
    13·1 answer
  • _____ _____ deals with the definitions properties of mathematical models of computation.
    8·1 answer
  • Which types of computers are used by large businesses
    10·1 answer
  • Raul in Colombia can enter data into a spreadsheet. Olivia in England can access the spreadsheet a few minutes later and use Rau
    7·1 answer
  • Write a method called min that takes three integers as parameters and returns the smallest of the three values, such that a call
    13·1 answer
  • Adam's interview with the hiring manager is going well. However, he wants to ensure that his skills and work history are memorab
    6·1 answer
  • Iciples UI
    12·1 answer
  • What can I do If my Texas Instrument TI-84 calculator is not giving accurate answers?
    6·1 answer
  • If I want to make it look like slide number one is turning a page to slide number two, what
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!