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]
2 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]2 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
Changing the configuration of a database falls under which category of databaseâ administration?
harkovskaia [24]
Changing the configuration of a database falls under which category of databaseâ administration?

d. operation
8 0
3 years ago
I dont know how to put the negative sigh on my computer
valina [46]
You put the dash on the right side up top ape
8 0
3 years ago
Read 2 more answers
Which of the following is the fastest way to open an Access database? a. Right-click the database icon. b. Start Access from the
STALIN [3.7K]

Answer:

C. Double-click the database icon.

5 0
3 years ago
Read 2 more answers
System memory is on a computer motherboard?
Leya [2.2K]
Is this a true or fales question

8 0
3 years ago
Read 2 more answers
Answers please !!!!!!!!!!!!!!!!!!!!!!!!!!!
alina1380 [7]
Hard to see please add a better image. Actually just type out the question.
4 0
4 years ago
Other questions:
  • Create a function average_temp(s) that accepts a file name s that contains temperature readings. Each line in the file contains
    15·1 answer
  • In some cases, certain Hyper-V guest operating system features do not function properly using the operating system's own device
    9·1 answer
  • Find some search engine as many that you can find
    9·1 answer
  • Jennifer's company currently uses Windows Active Directory to provide centralized authentication, authorization, and accounting
    14·1 answer
  • As a consommé simmers, the meat and eggs coagulate, forming a
    6·1 answer
  • The building blocks of coded language are called
    11·2 answers
  • Consider the following code snippet:
    13·1 answer
  • Which of these is not a valid form<br>layout in Microsoft Access?​
    11·1 answer
  • How much would it cost to get the screen replaced on a Moto G7?
    10·1 answer
  • What is computer give definition ​
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!