100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
Chapter-5 ARITHMETIC AND LOGIC INSTRUCTIONS UET Taxila COMPUTER MISC $7.99   Add to cart

Exam (elaborations)

Chapter-5 ARITHMETIC AND LOGIC INSTRUCTIONS UET Taxila COMPUTER MISC

 5 views  0 purchase
  • Course
  • Institution

ARITHMETIC AND LOGIC INSTRUCTIONS 1. Select an ADD instruction that will: (a) add BX to AX (b) add 12H to AL (c) add EDI and EBP (d) add 22H to CX (e) add the data addressed by SI to AL (f) add CX to the data stored at memory location FROG (g) add 234H to RCX A. (a) ADD AX,BX (b) ADD AL,12...

[Show more]

Preview 2 out of 6  pages

  • February 16, 2023
  • 6
  • 2022/2023
  • Exam (elaborations)
  • Questions & answers
avatar-seller
CHAPTER NO 5
ARITHMETIC AND LOGIC INSTRUCTIONS
1. Select an ADD instruction that will:
(a) add BX to AX
(b) add 12H to AL
(c) add EDI and EBP
(d) add 22H to CX
(e) add the data addressed by SI to AL
(f) add CX to the data stored at memory location FROG
(g) add 234H to RCX
A. (a) ADD AX,BX (b) ADD AL,12H (c) ADD EBP,EDI (d) ADD CX,22H (e) ADD AL,[SI]
(f) ADD FROG,CX (g) ADD RCX,234H
2. What is wrong with the ADD RCX,AX instruction?
A. You cannot use mixed-size registers
3. Is it possible to add CX to DS with the ADD instruction?
A. No instruction is available to add to a segment register.
4. If and , list the sum and the contents of each flag register bit
(C, A, S, Z, and O) after the ADD AX,DX instruction executes.
A. AX = 3100H, C = 0, A = 1, S = 0, Z = 0, and O = 0
5. Develop a short sequence of instructions that adds AL, BL, CL, DL, and AH. Save the sum
in the DH register.
A. ADD AH,AL
ADD AH,BL
ADD AH,CL
ADD AH,DL
MOV DH,AH
6. Develop a short sequence of instructions that adds AX, BX, CX, DX, and SP. Save the sum
in the DI register.
A. ADD AX,BX
ADD AX,CX
ADD AX,DX
ADD AX,SP
7. Develop a short sequence of instructions that adds ECX, EDX, and ESI. Save the sum in
the
EDI register.
A. MOV EDI,ECX
ADD EDI,EDX
ADD EDI,ESI
8. Develop a short sequence of instructions that adds RCX, RDX, and RSI. Save the sum in
the
R12 register.
A. MOV DI,AX
MOV R12,RCX
ADD R12,RDX
ADD R12,RSI
9. Select an instruction that adds BX to DX, and also adds the contents of the carry flag (C)
to
the result.
A. ADC DX,BX
10. Choose an instruction that adds 1 to the contents of the SP register.
A. INC SP
11. What is wrong with the INC [BX] instruction?
A. he instruction does not specify the size of the data addressed by BX and can be
corrected with a BYTE PTR, WORD PTR, DWORD PTR, or QWORD PTR
12. Select a SUB instruction that will:



This study source was downloaded by 100000850872992 from CourseHero.com on 02-16-2023 10:39:04 GMT -06:00


https://www.coursehero.com/file/68941336/Chapter-5docx/

, CHAPTER NO 5
ARITHMETIC AND LOGIC INSTRUCTIONS
(a) subtract BX from CX
(b) subtract 0EEH from DH
(c) subtract DI from SI
(d) subtract 3322H from EBP
(e) subtract the data address by SI from CH
(f) subtract the data stored 10 words after the location addressed by SI from DX
(g) subtract AL from memory location FROG
(h) subtract R9 from R10
A. (a) SUB CX,BX (b) SUB DH,0EEH (c) SUB SI,DI
(d) SUB EBP,3322H (e) SUB CH,[SI] (f) SUB
DX,[SI+10] (g) SUB FROG,AL (h) SUB R10,R9
13. If and , list the difference after BH is subtracted from DL and show
the contents of the flag register bits.
A. L = 81H, S = 1, Z = 0, C = 0, A = 0, P = 0, O = 1
14. Write a short sequence of instructions that subtracts the numbers in DI, SI, and BP from
the
AX register. Store the difference in register BX.
A. MOV BX,AX
SUB BX,DI
SUB BX,SI
SUB BX,BP
15. Choose an instruction that subtracts 1 from register EBX.
A. DEC EBX
16. Explain what the SBB [DI–4],DX instruction accomplishes.
A. he contents of DX and the carry flag are subtracted
from the 16-bit contents of the data segment memory
addressed by DI – 4 and the result is placed into DX.
17. Explain the difference between the SUB and CMP instruction.
A. Both instructions subtract, but compare doe not return the difference, it only
changes the flag bits to reflect the difference.
18. When two 8-bit numbers are multiplied, where is the product found?
A. AH (most significant) and AL (least significant)
19. When two 16-bit numbers are multiplied, what two registers hold the product? Show the
registers that contain the most and least significant portions of the product.
A. AH contains the most significant part of the result and AL contains the least
significant part of the result
20. When two numbers multiply, what happens to the O and C flag bits?
A. The O and C flags contain the state of the most significant portion of the product. If the
most significant
part of the product is zero, then C and O are zero
21. Where is the product stored for the MUL EDI instruction?
A. DX and EAX as a 64-bit product
22. Write a sequence of instructions that cube the 8-bit number found in DL. Load DL with a
5 initially, and make sure that your result is a l6-bit number.
DL = 0F3H BH = 72H
AX = 1001H DX = 20FFH
190
A. MOV DL,5
MOV AL,DL
MUL DL
MUL D
23. What is the difference between the IMUL and MUL instructions?



This study source was downloaded by 100000850872992 from CourseHero.com on 02-16-2023 10:39:04 GMT -06:00


https://www.coursehero.com/file/68941336/Chapter-5docx/

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller Themanehoppe. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $7.99. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

73091 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$7.99
  • (0)
  Add to cart