Question

. Write a sequence of instructions to compute the following arithmetic expression and store the result...

. Write a sequence of instructions to compute the following arithmetic expression and store the result in register DX: 7 + (-20) * 14 - (-10) * 8– 9

Trace the contents of registers, assume initial contents are 0000

Instruction

AX

BX

CX

DX

Remark

initial

0000

0000

0000

0000

Homework Answers

Answer #1

The sequence of instructions are as follows:

1.MOV AX,-20
2. MUL AX,14
3. MOV BX,-10
4. MUL BX,8
5. MOV CX,9
6. SUB AX,BX
7. SUB AX,CX
8. MOV DX,7
9. ADD DX,AX

The content of registers are shown as below:

Instruction AX BX CX DX Remark
Initial 0 0 0 0
MOV AX,-20 -20 0 0 0 Move -20 to Register AX
MUL AX,14 -280 0 0 0 Multiply 14 to Register AX
MOV BX,-10 -280 -10 0 0 Move -10 to Register BX
MUL BX,8 -280 -80 0 0 Multiply 8 to Register BX
MOV CX,9 -280 -80 9 0 Move 9 to Register CX
SUB AX,BX -200 -80 9 0 Subtract BX from AX and store the result in AX
SUB AX,CX -209 -80 9 0 Subtract CX from AX and store the result in AX
MOV DX,7 -209 -80 9 7 Move 7 to Register DX
ADD DX,AX -209 -80 9 -202 Add DX and AX and store the result in DX
Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Write a sequence of two instructions that copies bits 0-5 from AL to bits 0-5 in...
Write a sequence of two instructions that copies bits 0-5 from AL to bits 0-5 in BL. Bits 6-7 in BL should be cleared, and AL should be unchanged             Mov al, bl       And 00111111, bl       Write a sequence of two instructions that copies the integer in bits 4-7 from AL register into bits 0-3 of the BL register. Upper 4 bits of AL and BL will be cleared             Shr al, 4       Mov bl,...
Consider a program having following sequence of instructions, where the syntax consists of an opcode followed...
Consider a program having following sequence of instructions, where the syntax consists of an opcode followed by the destination register followed by one or two source registers: Instruction no Instructions 1 ADD R3, R1, R2 2 LOAD R6, [R3] 3 AND R7, R5, 3 4 ADD R1, R6, R0 5 SUB R2, R1, R6 6 AND R3, R7, 15 7 SUB R5, R3, R4 8 ADD R0, R1, R10 9 LOAD R6, [R5] 10 SRL R7, R0, 8 Assume the...
Assignment-I Write the output for the following instructions MOV B , A             Before instruction execution, the...
Assignment-I Write the output for the following instructions MOV B , A             Before instruction execution, the contents of registers B and A are                                  Rd= B= XBH                         Rs= A = 1FH              After the execution of instruction.                                 Rd= B = ?                         Rs= A = ? ADD B If A= E 3H   B=  0 4H then after the  execution of the above instruction the content of A = ? SUI 03H If the value of A = 15Hthen after the execution of the above instruction...
High-level computer languages are created to be understood by humans. As a result, the keywords and...
High-level computer languages are created to be understood by humans. As a result, the keywords and the commands of these languages are easy to understand. Machine languages are harder to understand and operate. For this assignment, you should assume that the memory cells at addresses F0 to F9 are in the machine described here: Op-Code Operand Description 1 RXY LOAD the register R with the bit pattern found in the memory cell whose address is XY 2 RXY LOAD the...
Microprocessor 8086 material. Choose the correct answer. 1- For a (64K x 8) RAM, the number...
Microprocessor 8086 material. Choose the correct answer. 1- For a (64K x 8) RAM, the number of address lines is: * 17 19 16 15 20 14 18 2-Which of the following instructions requires (BYTE PTR)? * SHR [500H], 3h LDS SI, [1000H] LAHF PUSH [9AAH] ADD AX, [800H] 3-Where are the interrupt vectors located in the microprocessor’s memory? * in the first 64K byte in the first 1K byte in the first 256K byte in the first 1M byte...
Write a Java program to print the result of the following operations. Your program should contain...
Write a Java program to print the result of the following operations. Your program should contain 4 methods (for each of given data sets). Yes, methods here are not structurally necessary, this requirement is only for you to get practice writing methods. Test Data: a. -8 + 4.0 * 6 b. (11+9) % 9 c. 20 + (-3)*3.0 / 8 d. 5 + 14 / 3 * 2 - 7 % 3 Your program:
Python: Write a program that prompts the user to enter a positive integer value, and compute...
Python: Write a program that prompts the user to enter a positive integer value, and compute the following sequence: • If the value is even, halve it. • If it's odd, multiply by 3 and add 1. • Repeat this process until the value is 1, printing out each value. • Then print out how many of these operations you performed. If the input value is less than 1, print a message containing the word Error and exit the program....
AMD 376 Merchandise Planning and Control Instructions :Please write down all calculation procedures used to come...
AMD 376 Merchandise Planning and Control Instructions :Please write down all calculation procedures used to come up with the final answer on a separate sheet of paper. Please circle or highlight your final answer. Missing calculations and not rounding to TWO decimal places (where applicable) will result in zero points. Each question is worth 5 points. 1.A buyer was shopping for women’s blouses and selected a group priced at $175.00 per dozen. Merchandising considerations dictated a markup of 58.5%.Calculate the...
3.   Consider the following data set for an office structure built by Anderson Construction Co. The...
3.   Consider the following data set for an office structure built by Anderson Construction Co. The completed building is nine stories. However, construction was interrupted by a fire after 5.3357 floors were completed. At the time of the fire, Anderson had used 54,067 hours of labor to construct the first 5.3357 stories of the building. It then took Anderson an additional 40,750 labor hours to complete this nine-story building. In this problem, FLRCOM is the number of floors completed, and...
1) Describe an example of each of the following that may be found of your kitchen:...
1) Describe an example of each of the following that may be found of your kitchen: Explain how your choice falls into this category, and if there is a chemical name or symbol for it, provide that as well. Provide a photo of your example with your ID card in it. a) a compound b) a heterogeneous mixture c) an element (symbol) Moving to the Caves… Lechuguilla Caves specifically. Check out this picture of crystals of gypsum left behind in...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT