Question

Question 1: Fill the blank cells below. Assume that X=$1000. (20 marks) Addressing mode Effective address [A] Instruction LDA

HCS12

0 0
Add a comment Improve this question Transcribed image text
Answer #1

I have given explanation in the table itself. Please refer to that.

Instruction

Addressing Mode

Effective Address

[A]

Explanation

LDAA 2,X+

Index Mode

Indexed with Auto Pre increment of index register

1000

[$1000]

This will load the accumulator with the address specified in the variable x.

Since this is post increment, the accumulator will have the value [$1000] and after loading the Accumulator, x will be incremented by 2. [$1000+2 = $1002]

LDAB #$A

Extended mode

1000

NA

Inform the assembler about the place where the ensuing instruction needs to be placed.

LDAB #$A will store the value of A into B.

B will have the value $1000

ABA

Inherent mode

1000

[$2000]

ABA means A=A+B

Add the value of A&B and store it in the Accumulator

According to previous instruction A has 1000 and B has 1000. So now according to the current instruction A will have $2000

STAA 4,X

Indexed Mode

Indexed with Constant offset

1006

No change

[$2000]

Stores the contents of A in the given memory location.

First this will add 4 to X and then copy the value of the Accumulator to the memory location

x = 1002 (as per instruction 1)

x = 1002 + 4 = 1006

Now 1006 will have $2000

LDAA [1, FFD]

Indexed mode

16-bit offset Indirect Indexed Addressing

FFE

10

Load contents of [1+FFD] to the accumulator

[1+FFD] = FFE (refer diagram given by you)

The value of FFE is 10 (ref diagram)

So accumulator will have the value 10

Note: I have considered the value of each registers and variables by using the previous instruction as reference. Supoose those instruction are not series of single code snippet then you can change the value alone with the help of the explanation.

Add a comment
Know the answer?
Add Answer to:
HCS12 Question 1: Fill the blank cells below. Assume that X=$1000. (20 marks) Addressing mode Effective...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • ANSWER NUMBER 2 PLEASE 1. Briefly explain what the overall purpose of this program is and...

    ANSWER NUMBER 2 PLEASE 1. Briefly explain what the overall purpose of this program is and complete the memory table below which should show what is in memory after the program has been run. (e.g. Purpose: finds largest of five numbers) $1000 DC.B $18, $39, $E1, $8B, $15 ORG TABLE ORG $2000 LDX #TABLE LDAB #5 LDAA 0, X STAA 5, X LOOP INX DBNE B, LOOP BRA $1000 $1001 $1002 $1003 $1004 $1005 $1006 $1007 $1008 $1009 2. Assuming...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT