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
In GamePoints' constructor, assign teamWhales with 500 and teamLions with 500. #include using namespace std; class GamePoints {
xxMikexx [17]

Answer:

Here is the GamePoints constructor:

GamePoints::GamePoints() :

/* Your code goes here */

{

teamLions = 500;

teamDolphins = 500;

}    

Explanation:

Here is the complete program:

#include  //to use input output functions

using namespace std; //to identify objects like cin cout

class GamePoints {  //class GamePoints

   public: GamePoints(); // constructor of GamePoints class

   void Start() const;  //method of GamePoints class

   private: //declare data members of GamePoints class

   int teamDolphins; // integer type private member variable of GamePoints

   int teamLions; }; // integer type private member variable of GamePoints

   GamePoints::GamePoints()  //constructor

    { teamLions = (500), teamDolphins= (500); }   //assigns 500 to the data members of teamLions  and teamDolphins of GamePoints class

   void GamePoints::Start() const    { //method Start of classs GamePoints

       cout << "Game started: Dolphins " << teamDolphins << " - " << teamLions << " Lions" << endl; }  //displays the values of teamDolphins and teamLions i.e. 500 assigned by the constructor

       int main() //start of main() function

       { GamePoints myGame;  // creates an object of GamePoints class

       myGame.Start(); //calls Start method of GamePoints class using the object

       return 0; }

The output of the program is:

Game started: Dolphins 500 - 500 Lions                    

8 0
3 years ago
Which will you see on the next line 9, 2, 3.5, 7]
elena55 [62]

Answer:

plenipotentiaries. It was by far the most splendid and

important assembly ever convoked to discuss and

determine the affairs of Europe. The Emperor of

Russia, the King of Prussia, the Kings of Bavaria,

Denmark, and Wurttemberg, all were present in

person at the court of the Emperor Francis I in the

Austrian capital. When Lymie put down his fork and

began to count them off, one by one, on the fingers

of his left hand, the waitress, whose name was Irma,

thought he was through eating and tried to take his

plate away. He stopped her. Prince Metternich (his

right thumb) presided over the Congress, and

Prince Talleyrand (the index finger) represented

France? please let me know if this is the answer you were looking for!!

5 0
3 years ago
Read 2 more answers
1. Before operating any power tool, you need to
Anna007 [38]

Answer:

where glasses gloves turn on the power tool

Explanation:

7 0
2 years ago
PLEASE HELP!!! History abounds with instances in which the work of scientists and artists were affected by the political, religi
Masteriza [31]
Social Media affects them
7 0
3 years ago
Identify 3 distractions for young drivers and explain how you plan to minimize these distractions.
Rom4ik [11]
1 distraction is phones , texting and driving . They could have a system in their car which activated by a voice assistant who could do it al for them
4 0
3 years ago
Other questions:
  • What is the IEEE standard for the Wi-Fi Protected Access 2 (WPA2) security protocol?
    6·1 answer
  • You should use html elements instead of server controls when
    11·1 answer
  • PLEASE HELP QUICK WILL GIVE BRAINLY
    6·1 answer
  • What does my name look like in binary code, btw my mane is Wendy Alexis Morales
    10·2 answers
  • Write a program to enter a number and test if it is greater than 45.6. If the number entered is greater than 45.6, the program n
    10·1 answer
  • Does anyone know a good reason WHY to change your username.
    5·1 answer
  • Fill in the word to complete the sentence.
    10·1 answer
  • The hexadecimal eqquivalent of (80)10 is
    11·1 answer
  • Java question
    15·1 answer
  • What is required to publish documents on the Web
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!