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
Write a program named split_me.py that accepts a string in the format Age.FirstName and returns the value FirstName is Age years
zmey [24]

age,name = input('Enter a string: ').split('.')

print(name+' is '+age+' years old. Length of '+name+' is '+str(len(name)))

I wrote my code in python 3.8. I hope this helps.

5 0
3 years ago
PLS HELP!!
Vera_Pavlovna [14]

Answer:

A. f/2.8

Explanation:

A hole within a lens, through which light travels into the camera body is referred to as the APERTURE.

It is typically expressed as "f number" in photography. Basically, a fast lens is any lens with a maximum aperture of f/4 or more i.e f/2.8 , f/1.8 , f/1.4 etc.

The smaller the number is the bigger the maximum aperture is. Hence, the bigger the maximum aperture the more light that your lens will allow in.

Therefore, the ideal aperture settings for a fast lens is f/2.8

7 0
2 years ago
When was Microsoft released to public schools?
Studentka2010 [4]
April 4
1975...$.$.$.........&.$.$.$....................
8 0
3 years ago
This is not what I asked for​
jolli1 [7]
?? What does that mean? What is the question
3 0
2 years ago
Does scope frequently changes during a project?<br>​
lesya [120]

Answer:

no

Explanation:

6 0
3 years ago
Read 2 more answers
Other questions:
  • You have already learned about the various types of lenses. Now, conduct online research and mention as many possible types of l
    9·1 answer
  • List and explain the error in the code
    14·1 answer
  • Networks that are designed to connect similar computers that share data and software with each other are called:
    10·1 answer
  • If you want to open the Navigation pane to do a Find, what should you first click on the Home tab? Paragraph, Editing, Styles, o
    15·1 answer
  • Implement a recursive program that takes in a number and finds the square of that number through addition. For example if the nu
    5·1 answer
  • The Spanning Tree Protocol operates at the Network layer of the OSI model.
    13·1 answer
  • Which of the following is a particularly useful feature of Microsoft PowerPoint and
    8·2 answers
  • The table button is present in the ……… tab.​
    14·2 answers
  • The memory used by the CPU to temporarily hold data while processing is called _______. random access memory central processing
    5·1 answer
  • Which of the following best explains how the Internet is a fault-tolerant system?
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!