
68 Assembly Language Programming for the 68000 Family
Exercises
Assume longword operands unless otherwise specified.
1. What CCR bit is used to detect overflow of unsigned arithmetic
operations?
2. What CCR bit is used to detect overflow of signed arithmetic opera
tions?
3. Is there a limit as to how far away the label of a conditional branch
may be?
4. What CCR bit determines if the result of an arithmetic operation is
zero?
5. What CCR bit determines if the result of an arithmetic operation is
positive or negative?
6. What is the difference between the CMP instruction and the SUB
instruction?
7. Write the instructions necessary to branch to label STOP if the DO
register is equal to 100.
8. Write the instructions to branch to label BIGER if register DO is larger
than variable LIMIT. Assume unsigned values.
9. What CCR bits were discussed in this chapter?
10. Are all the bits of the CCR used?
11. If we add the following unsigned bytes, will the carry bit be set? The
values are in decimal.
55 and 27
150 and 110
12. If we add the following signed bytes, will the overflow bit be set?
The values are in decimal.
—100 and +50
—100 and —50
13. Write the instructions necessary to add the signed values in the DO
and D1 register and branch to label OK if there is no overflow.
14. Repeat the above problem for unsigned values.
15. Write the instructions necessary to test if register DO is zero and, if
so, to branch to label ZERO.
16. Write the instructions necessary to compare variables NUM1 and
NUM2, branching to label EQUAL if they are equal, to label LESS
if NUM1 is less than NUM2. Assume signed values.
17. Write the equivalent of the DBRA instruction using instructions intro
duced in this chapter.
18. What is the purpose of the extend bit?
19. What is the advantage of using ADDQ and SUBQ rather than ADD
AND SUB?
Komentáře k této Příručce