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
love history [14]
3 years ago
7

Write an assembly code to implement the y=(x1+x2)*(x3+x4) expression on 2-address machine, and then display the value of y on th

e screen. Assume that the values of the variables are known. Hence, do not worry about their values in your code.
The assembly instructions that are available in this machine are the following:
Load b, a Load the value of a to b
Add b, a Add the value of a to the value of b and place the result in b
Subt b, a Subtract the value of a from the value of b and place the result in b
Mult b, a Multiply the values found in a and b and place the result in b
Store b, a Store the value of a in b.
Output a Display the value of a on the screen
Halt Stop the program
Note that a or b could be either a register or a variable. Moreover, you can use the temporary registers R1 & R2 in your instructions to prevent changing the values of the variables (x1,x2,x3,x4) in the expression.
In accordance with programming language practice, computing the expression should not change the values of its operand.
Computers and Technology
1 answer:
Ratling [72]3 years ago
7 0

mbly code to implement the y=(x1+x2)*(x3+x4) expression on 2-address machine, and then display the value of y on the screen. Assume that the values of the variables are known. Hence, do not worry about their values in your code.

The assembly instructions that are available in this machine are the following:

Load b, a Load the value of a to b

Add b, a Add the value of a to the value of b and pla

You might be interested in
Write a program to prompt the user for hours worked to compute a gross pay for an employee, and he is paid 100/hour. If he worke
Elenna [48]

Answer:

rate = 100

hours_worked = eval(input('enter number of hours worked'))

gross_pay = hours_worked * rate

if hours_worked <= 40 :

print(gross_pay)

else:

print(gross_pay + (1.5*rate*(hours_worked -40)))

Explanation:

Using python 3 :

The rate of pay is defined using the rate variable

The user is the prompted to enter the number of hours worked.

Gross_pay gives the mathematical evaluation of the amount paid base in rate and hours worked.

Since hours beyond 40 are paid as overtime. Then we have to add that to those who worked above 40 hours.

If hours_worked is 40 and below, then use gross pay

If gross pay is above 40 ; then the overtime fee is added to gross pay using the rate provided.

6 0
3 years ago
What do I need to write ??
Alexxx [7]

print('Welcome')

name = input('Please enter your name : ')

age = int(input('Your age : '))

print('Your name is',name,'and you have',age,'years old')

8 0
3 years ago
Select the correct answer.
vovangra [49]

Answer:

B.

Learn from both successful and unsuccessful logos.

8 0
3 years ago
A ____ is any key that uniquely identifies each row.
Mrac [35]
<span>A _superkey___ is any key that uniquely identifies each row.</span>
6 0
3 years ago
After unit and integration testing are completed, _________ testing ensures that all hardware and software components work toget
raketka [301]
Testing ensures that all hardware and software components work together
5 0
3 years ago
Other questions:
  • What is “centrifugal bumble puppy”? why is it important for games to require a complicated apparatus?
    10·2 answers
  • Can someone please find the IP address of a 3630 hp printer?
    8·1 answer
  • For example, consider a file with protection mode 644 (octal) contained in a directory with protection mode 730. How might the f
    9·1 answer
  • Can anyone please help me to solve this question?
    10·1 answer
  • Pls help me im confused prob more on the way
    6·1 answer
  • Please help me I need a help
    13·1 answer
  • Fix the code :)
    10·1 answer
  • the image on the right was prooduced by a computer. it shows a complex molecu;e consisting of many atoms. what would be an advan
    6·1 answer
  • After data is collected, how is it analyzed?
    10·1 answer
  • the php function that is executed is a connection to a database cannot be made is the____ function. die | isset| end | connect.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!