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
insens350 [35]
3 years ago
10

Using MARS/MIPS

Computers and Technology
1 answer:
slega [8]3 years ago
5 0

Answer:

Explanation:

MIPS program which increments from 0 to 15 and display results in Decimal on the console

In this program the user defined procedures print_int and print_eot were used to print the integer values and new line characters(\n) respectively.the mechanisam of the loop is explaine in the comment section of the program.

     addi $s0, $0, 0

     addi $s1, $0, 15

print_int:

              li $v0, 1                # system call to print integer

              syscall                

              jr $ra                     # return

print_eol:                      # prints "\n"

            li $v0, 4            

              la $a0, linebrk      

              syscall              

              jr $ra                  # return

main: . . .          

              li $a0, 0                # print 0

              jal print_int         # print value in $a0

loop:   move $a0, $s0           # print loop count

       jal print_int        

       jal print_eol           # print "\n" character

       addi $s0, $s0, 1        # increment loop count by 1

       ble $s1, $s0, loop      # exit if $s1<$s0

beq $s0, $0, end

end:

MIPS progam to increment from 0 to 15 and display results in Hexadecimal on the console

this program is slightly differed from the previous program in this program the system call issued in print_int is implemented with a system call that prints numbers in hex.

addi $s0, $0, 15

     addi $s1, $0, 0

print_int:

   li      $v0,34                  # syscall number for "print hex"

   syscall                         # issue the syscall

              jr $ra                     # return

print_eol:                      # prints "\n"

            li $v0, 4            

              la $a0, linebrk      

              syscall              

              jr $ra                  # return

main: . . .          

              li $a0, 0                # print 0

              jal print_int         # print value in $a0

loop:   move $a0, $s0           # print loop count

       jal print_int        

       jal print_eol           # print "\n" character

       addi $s0, $s0, 1        # increment loop count by 1

       ble $s1, $s0, loop      # exit if $s0>$s1

beq $s0, $0, end

end:

You might be interested in
Design a circuit that has a 3-bit binary input B2, B1, B0 (where B2 is most significant bit and B0 is least significant bit) and
jenyasd209 [6]

Isn't this circuit just a wire, where Z=B0?

3 0
3 years ago
Swapping two numbers
Tju [1.3M]

Answer:

Swapping two numbers means exchange the values of two variables with each other.

8 0
3 years ago
Please help!
Darya [45]
The answer would be A.) Web pages provide information, while web applications allow the user to do something. a web page is for relaying information. (you can relate this to a book. a page in a book gives you information.) while an application allows you to perform an action.
4 0
3 years ago
Read 2 more answers
A bulb has a resistance of 15Ω and is rated at 3A. What is the maximum voltage that can be applied across the bulb?
Anastasy [175]

Answer:Wheres the option choice??????????????????????

Explanation:

7 0
2 years ago
4.11 lesson practice <br> Need help
NNADVOKAT [17]

Answer:

Computer modeling.

Explanation:

Computational modeling is characterized by the use of computers to represent a real world situation, that is, it is the use of mathematical models to assist in solving problems in multidisciplinary areas essential for the development of science and technology. Through computational modeling it is possible to adjust several study variables and achieve greater probabilities of reaching an effective result more quickly and at a lower cost.

Through this system it is possible to solve complex problems such as scientific research, product development, analysis and predictions about certain phenomena, development of technology applied to health, etc.

4 0
2 years ago
Read 2 more answers
Other questions:
  • Is anyone else experiencing the wording::nonifacation::glitch about the "5 hours ago" thingy to whenever you answer a question o
    7·2 answers
  • The INC and Dec instruction do not effect the__________ flag
    6·1 answer
  • What is the correct process for selecting an entire row in a spreadsheet?
    8·2 answers
  • "In a web app, where is data usually stored? A. Mobile network B. Application storage C. Local computer D. Cloud storage"
    14·1 answer
  • What do you think is the most fascinating aspect of the internet?
    7·2 answers
  • I need help<br> plsssssssss
    10·1 answer
  • Ivan wants to have code in a game that will make it possible to change the speed of a swimmer in the game. Which of these does I
    8·1 answer
  • What does a for loop look for in the sequence of data? Check all that apply.
    6·2 answers
  • Five plus six is equal to?​
    10·2 answers
  • As of 2019, approximately how much of the world population actively access the internet?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!