Page 47 - Introduction to Microcontrollers Architecture, Programming, and Interfacing of The Motorola 68HC12
P. 47
24 Chapter 1 Basic Computer Structure and the 6812
9 , What is the effective address in the following instructions, assuming the opcode
byte is at $802?
(a)LDAA 122
(b)LDAA #122
(c)ADDA $3452
(d)ADDA #125
10. Rewrite Figure 1.5 to subtract the 8-bit number in location $840 from the 8-bit
number in location $841, putting the result into location $842. Use SUBA.
11. How many clock cycles does it take to execute the program in Figure 1.5? (See the
operation code bytes table in the CPU12RG/D manual Instruction Set Summary.) If a
memory clock cycle is 125 nsec, how long does this program take, in real time?
12. Rewrite Figure 1.8 to subtract the 16-bit number in location $812 from the 16-bit
number in location $810, putting the result into location $814. Use SUBB and SBCA.
13. Rewrite Figure 1.9 to subtract the 16-bit number in location $812 from the 16-bit
number in location $810, putting the result into location $814. Use SUBA and SBCA.
14. How many clock cycles does it take to execute the program in Figure 1.8 and the
program in Figure 1.9? (See the operation code bytes table in the CPU12RG/D manual.)
If a memory clock cycle is 125 nsec, how long does this program take, in real time?
15. Rewrite Figure 1.10 to subtract the 16-bit number in location $812 from the 16-bit
number in location $810, putting the result into location $814. Use SUED.
16. How many clock cycles does it take to execute the program in Figure 1.10? (See
the operation code bytes table in the CPU12RG/D manual.) If a memory clock cycle is
125 nsec, how long does this program take to execute in real time?
11. How many parallel ports of the narrow expanded mode of the MC68HC812A4,
which are already on the microcontroller chip, can be used? How many parallel ports of
the wide expanded mode of the MC68HC812A4, which are already on the microcontroller
chip, can be used? In the latter case, how many can be used for output?
18. How many parallel ports of the narrow expanded mode of the MC68HC912B32,
which are already on the microcontroller chip, can be used? How many parallel ports of
the wide expanded mode of the MC68HC912B32, which are already on the
microcontroller chip, can be used? In the latter case, how many can be used for output?
19. In Figure 1.16, an external memory is 16 bits wide, but most static random access
memories (SRAMs) are 8 bits wide. If a 16 Kbyte external memory is to be used as
shown in this figure, what kind of SRAM chips should be ordered? How should the
microcontroller address bus be attached to the SRAM chip address pins?