1. Write one line of HCS12 assembly language to do the following. (Note that add
ID: 2079918 • Letter: 1
Question
1. Write one line of HCS12 assembly language to do the following. (Note that adds and subtracts are without carry.)
a. Clear register A
b. Add the number hexadecimal C7 to register B
c. Add the contents of memory location $0054 to register A
d. Subtract the contents of memory location $16CF from register B
e. Fetch data from the memory location indicated by register X and load it into register A
f. Fetch data from the memory location indicated by register Y plus 8 and add it to register B
g. Increment register X by 12 and then use it as the address to fetch data and load it into register A
h. Use register Y as an address to fetch data and add it to register B, then decrement Y by 8
i. Move 1 word (16 bits) from the location indicated by register X to the location indicated by register Y.
2. Briefly explain what each line of HCS12 assembly language does:
a. CLRB
b. INCA
c. SUBA #7
d. TFR X,Y
e. EXG A,B
Explanation / Answer
1.
(a) CLRA
(b) ADDB C7
(c) ADDA #0054
(d) SUBB #16CF
(e) LDAX
STAA
(f) LDAY+LDA8
STAB
2.
(a) CLRB is used to clear register B
(b) INCA is used toincrement register A
(c) SUBA #7 is used to subtract a number from address 7 to A
(d) TFR X,Y is transfer from register X to Y
(e) EXG A,B menas exchange data between A and B
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.