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
Zarrin [17]
3 years ago
6

Write an assembly subroutine that check if a number is in the interval of [0, 10] and return 1 if the number is in this interval

and 0 otherwise. Call this subroutine to check if each integer in an array in the memory is in this interval and write the results of all numbers into another array in the memory
Computers and Technology
1 answer:
Setler79 [48]3 years ago
5 0

Answer:

.data

array: .word 1,3,5,7,9,11,13,15,17,19

result: .word 0,0,0,0,0,0,0,0,0,0

.text

  la $s0, array

  la $s1, result

  addi $t0, $zero, 0

  INTERVAL:  bge $t0, 10, END

     sll $t1, $t0, 2

     add $t2, $s0, $t1

     lw $t2, 0($t2)

     jal LIMIT

     IF:    bne $a0, 1, ELSE

        add $t3, $s1, $t1

        sw $t2, 0($t3)

     ELSE:

     addi $t0, $t0, 1

     j INTERVAL

  END:    

  addi $v0, $zero, 10

  syscall

  LIMIT:  

     addi $a0, $zero, 0

     START: bge $t2, 0, NEXT

        b ENDLIMIT

     NEXT:  ble $t2, 10, SET

        b ENDLIMIT  

     SET:   addi $a0, $zero, 1

     ENDLIMIT:

     jr $ra

Explanation:

The assembly source code is used to create a subroutine called "INTERVAL" that checks if a number from an array is in a range of 1 to 10. The program returns 1 if the condition is met but 0 if otherwise.

You might be interested in
When did the mantle of the earth form
Musya8 [376]
It formed <span>about 4.5 billion years ago</span><span> </span>
5 0
3 years ago
Read 2 more answers
You have to sort 1 GB of data with only 100 MB of available main memory. Which sorting technique will be most appropriate?
Arte-miy333 [17]
I’m guessing that what’s being looked at here moreso is the space complexity of these algorithms. Heap sort and insertion sort I believe have the lowest of these, but insertion sort is also known to not be the best with time complexity. Therefore heap sort should take the cake
8 0
4 years ago
Assume that you have created a class named DemoCar. Within the Main() method of this class, you instantiate a Car object named m
marysya [2.9K]

Answer:

It can be static, but it shouldn't, given the way it is invoked.

It can also be protected but <u>not</u> private.

Explanation:

The question is confusing, since the ComputeMpg() should be a public non-static member. Also, is this Java or C#?

5 0
3 years ago
Which of the following are benefits of designing a scalable system? Choose 3 options.
Svetllana [295]

Explanation:

ability to maintain a high level of service for costumers

users may never know when a sight has experienced tremendous growth

ability to respond to users volume issues more quickly

4 0
3 years ago
Which activity does not allow a person to perform any work while at the shop
polet [3.4K]

Is it apprenticeship???:D

5 0
3 years ago
Other questions:
  • Which protocol is often used to publish web pages to a web server?
    5·1 answer
  • using C++ to sort user input. for example, user enter 25numbers and sort them from small to big or big to small, cout thesamlles
    6·1 answer
  • Claire is trying to listen to her history professor's lecture, but her mind keeps wandering to thoughts about her plans for the
    5·1 answer
  • The parameter passing mechanisn used in C is
    5·2 answers
  • I have to write this in Java, but i've never even learned it before and i'm completely lost
    12·1 answer
  • Which is not a factor that leads to technological advancement?
    8·1 answer
  • You need to update both the DEPARTMENT_ID and LOCATION_ID columns in the EMPLOYEES table using one UPDATE statement. Which claus
    5·1 answer
  • I used the app and my answers were still wrong??????how
    8·2 answers
  • A bank wants to reject erroneous account numbers to avoid invalid input. Management of the bank was told that there is a method
    8·1 answer
  • How many 3 byte sequences contain at least five consecutive 0-bits
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!