Sie sind auf Seite 1von 4

CHAPTER 2: HCS12 ARCHITECTURE & ASSEMBLY LANGUAGE PROGRAMMING

SECTION 2.1: INSIDE THE HCS12


1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.

16
8
8
FFH
necessary
The result is 28H, stored in Accumulator A.
In (a) and (d) the operand exceeds allowed range. The syntax of (g) is wrong, since
ADDA can have only one operand ( ADDA mybyte , or , ADDA #$50 ).
(a), (c) and (d) exceed the allowed range.
The result is 44H in accumulator A.
The result is FFH in accumulator A.
FFH
False. There is only one register A and one register B.

SECTION 2.2: THE HCS12 MEMORY MAP


13.
14.
15.
16.
17.
18.
19.
20.

21.
22.
23.
24.
25.
26.

64KBytes
True
False. Registers are part of Register space.
True
False
False. There are also Register Space and unused space.
(a) 14 KBytes
(b) 1 KBytes
Data RAM is used to store temporary data, and when power goes off its information is
lost. But, we use EEPROM to store nonvolatile data that must remain intact even when
the power is turned off.
Yes, some chips have no EEPROM, page 66.
No, the HCS12 needs RAM for volatile data.
Flash.
32 KBytes.
0000H
Registers 000-3FFF, RAM 0800-3FFF, EEPROM 7000-7FFF, Code ROM C000-FFFF

SECTION 2.3: HCS12 ADDRESSING MODES


27.
28.

800H
LDAA #$30
STAA $805
LDAA #$97
STAA $806

29.

30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.

LDAA #$55
STAA $300
STAA $301
STAA $302
STAA $303
STAA $304
STAA $305
STAA $306
STAA $307
STAA $308
LDAA #5F
STAA PORTB
(b) LDAA $30 is Extended mode addressing.
(a) Direct, (b) Immediate, (c) Extended, (d) Immediate, (e) Inherent, (f) Inherent
(a) 3 Byte, (b) 2 Byte, (c) 3 Byte, (d) 2 Byte, (e) 1 Byte, (f) 1 Byte
0000H
Direct Addressing
Immediate Addressing
Direct Addressing
Extended Addressing
Invalid
800H 8FFH
Registers X and Y
True

SECTION 2.4: CONDITION CODE REGISTER


43.
44.
45.
46.
47.
48.
49.

50.

8 bit
C = bit 0, H = bit 5
V = bit 1 , N = bit 3
The C flag = 1 when there is a carry out from the D7 bit after an 8-bit arithmetic
operation.
The H flag = 1 when there is a carry from the D3 to D4 bit after an 8-bit arithmetic
operation.
FFH + 1 = 100H, but since register A is only 8-bit the Z and C flags are both = 1.
(a) 118H, so C = 1
(b) FFH, so C = 0
(c) 104H, so C = 1
LDAA #$55
ADDA #$55
ADDA #$55
STAA $1200

SECTION 2.5: HCS12 DATA FORMAT AND DIRECTIVES


51.

MYDAT_1 = 37H
MYDAT_2 = 62H
MYDAT_3 = 47H
MYDAT_4 = 50H
MYDAT_5 = C8H
MYDAT_6 = 41H
MYDAT_7 = AAH
MYDAT_8 = FFH
MYDAT_9 = 90H
MYDAT_10 = 7EH
MYDAT_11 = 0AH
MYDAT_12 = 0FH

52.

DAT_1 = 16H
DAT_2 = 56H
DAT_3 = 99H
DAT_4 = 20H
DAT_5 = F6H
DAT_6 = 7BH

53.

R0 EQU $300
R1 EQU $301
R2 EQU $302
R3 EQU $303
R4 EQU $304
R5 EQU $305
(a)
LDAA #$11
STAA R0
STAA R1
STAA R2
STAA R3
STAA R4
STAA R5
(b)
CLRA
ADDA R0
ADDA R1
ADDA R2
ADDA R3
ADDA R4
ADDA R5

SECTION 2.6: INTRODUCTION TO HCS12 ASSEMBLY PROGRAMMING AND


SECTION 2.7: ASSEMBLING AND LINKING A HCS12 PROGRAM
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.

low - high
Assembly.
Assembler
True.
List file, with extension .lst .
False.
False. END is optional for HCS12, but is good practice to make the code readable.
No.
Because they only tell the assembler what to do and do not generate any op-codes.
True.
False.
True.
The file with .s19 extension is downloaded.
Three file extensions include: .asm , .lst , and .s19 .

SECTION 2.8: STACK AND DATA TRANSFER INSTRUCTIONS


68.
69.
70.
71.
72.

The stack pointer points to the last used location.


decremented, 2
incremented, 2
False, RAM is used for stack.
True

Das könnte Ihnen auch gefallen