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
We see color because an object that has light striking it
Pachacha [2.7K]
<span>We see color because an object that has light striking it reflects the color we see.  The object </span>has certain chemicals in it that when illuminated,  absorbs the color we see, reflects the color we see, <span>refracts all colors but the one we see.</span>
8 0
4 years ago
You are attempting to run a Nmap portscan on a web server. Which of the following commands would result in a scan of common port
Bess [88]

Answer:

Nmap CST CO CT0

Explanation:

Network map (Nmap) is a network scanning and host detection tool used in penetration testing to sorting out vulnerability in a network. Nmap APIs are used in packet sniffer tools as well to scan for available networks. There are different nmap command , but the command needed to scan a port with less noise to evade an IDS is the nmap's "Nmap CST CO CT0" command.

5 0
3 years ago
The union of two bags is a new bag containing the combined contents of the original two bags. Design and specify a method union
irga5000 [103]

Omg does your fingers hurt?????! Are u okay?? Cause u typed a lot you could have just pictured it. Poor thing

3 0
3 years ago
Primary U.S. interstate highways are numbered 1-99. Odd numbers (like the 5 or 95) go north/south, and evens (like the 10 or 90)
yanalaym [24]

Answer:

The solution in python.

Output:

   print("0 is not a valid interstate highway number")

Explanation:

h = int(input("enter highway number: ")) #take highway number

if(h>=1 and h<=99): #for primary highway

   if(h%2==0):

       print("I-%d is primary, going east/west" %h) #for even highway number

   else:

       print("I-%d is primary, going north/south" %h) #for odd highway number

elif(h>=100 and h<=999): #for auxiliary highway

   aux=str(h) #convert into string for fetch the rightmost number

   l=len(aux) #find the length

   val = aux[l-2]+aux[l-1] #assign value of rightmost two number

   h = int(val) #convert into integer

   if(h%2==0):

       print("I-"+aux+" is auxiliary,"+"serving I-%d, going east/west" %h)

   else:

       print("I-"+aux+" is auxiliary,"+"serving I-%d, going north/south" %h)

elif(h==0):#for 0 highway number

   print("0 is not a valid interstate highway number")

else:

   pass

7 0
3 years ago
A job posting is the best way to find out what _____ are required for a position.A.aptitudes B.hard skills C.soft skills D.dress
GREYUIT [131]
C. hard skills as they are well defined and thus can be listed down on something like a resume or cv
7 0
4 years ago
Read 2 more answers
Other questions:
  • An engineer is assigned the task of reducing the air pollutants being released from a power plant that generates electricity by
    9·1 answer
  • Create a test that prompts a user to enter a 5-digit PIN in the main procedure and then calls Validate PIN procedure to validate
    12·1 answer
  • What devices are used to connect computers to a network?
    10·1 answer
  • Yvonne found an article online that relates to her research topic, but the article does not cite the author. What should Yvonne
    8·2 answers
  • The _____ of each phrase in a melody can be drawn with a curved line that follows the direction of the note progression.
    15·1 answer
  • The traditional UNIX scheduler enforces an inverse relationship between priority numbers and priorities: the higher the numbe1~
    6·1 answer
  • 18. Hard skills can be used on almost any job. (3 points)<br> A. True<br> B. False
    13·2 answers
  • Trees 1. 2. 3. 4. 5.​
    6·1 answer
  • A major way the National Information Infrastructure Protection Act of 1996 amended the Computer Fraud and Abuse Act was the subs
    15·1 answer
  • Briefly describe the function of options in a linux command and give an example of a useful option.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!