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
Write a program in pascal to solve a quadratic equation
GalinKa [24]
Program p1;
var a,b,c,d : integer; {i presume you give integer numbers for the values of a, b, c }
     x1, x2 : real;
begin 
write('a='); readln(a);
write('b='); readln(b);
write('c=');readln(c);
d:=b*b - 4*a*c
if a=0 then x1=x2= - c/b
          else
if d>0 then begin 
                 x1:=(-b+sqrt(d)) / (2*a);
                 x2:=(-b - sqrt(d))/(2*a);
                end;
          else if d=0 then x1=x2= - b /(2*a)
                           else write ("no specific solution because d<0");
writeln('x1=', x1);
writeln('x2=',x2);
readln;
end.
5 0
3 years ago
What is a non-example of job outlook.
Papessa [141]

Answer:

Before you choose a career you should find out what its job outlook is. ... employed in a particular occupation over a set period, for example, two years, five years or ... 2% and 4%); Have little or no change (a decrease or increase of 1% or less) .

Explanation:

4 0
2 years ago
There are five identical closed boxes. one box contains $10,000, two boxes contain $1000 each, one box contains $1, and the last
sp2606 [1]
Mean means most and the most he can get is the 10000 and the 2 1000s and the 1 dollar so the mean is 12001.
6 0
3 years ago
Ignoring overhead for directories and file descriptors, consider a file system in which files are stored in blocks of 16k bytes.
irga5000 [103]

File size 41,600 bytes 640,000 bytes

7 0
2 years ago
Server 2016 is compatible for Powershell 5.0 State True or False.
Svetllana [295]

Answer:

True

Explanation:

Powershell is a command line administrative tool which ships with Windows. It is heavily integrated with the dotNET framework.

Powershell 5.0 is compatible with Windows 2016 however by default Windows 2016 comes with next higher version , namely 5.1 .

Powershell 5.0 is also compatible with Windows Server 2019, Windows Server 2012, Windows Server 2008 R2 SP1 , Windows 10, Windows 8.1 and Windows 7.

8 0
2 years ago
Other questions:
  • What command displays a computer s network settings?
    5·1 answer
  • What type of network is capable of delivering voice, video streams, text, and graphics between many different types of devices o
    15·1 answer
  • You're working in a table that has three columns and five rows. Since the first row will be a header row, you want it to span al
    5·1 answer
  • ___________ is an approach to boundary spanning that results from using sophisticated software to search through large amounts o
    8·1 answer
  • Which search engine do you prefer? Why
    15·2 answers
  • What is the empty space inside the character 'O' called?
    12·1 answer
  • Write a calculator program that will allow only addition, subtraction, multiplication &amp; division. Have the
    7·1 answer
  • I'm getting pretty desperate plz help me, I'll give brainiest, and ill make a free question worth 100 points this is for coding
    8·2 answers
  • It was field day for the upper grades at Rock Creek School,
    7·1 answer
  • What is the primary cause of the industrial revolution?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!