Question: Write the following program using HC11 assembly language: 1) Allocate memory (3 bytes) for multiplicand M 2) Allocate memory (1 byte) for multiplier N 3)

Write the following program using HC11 assembly language:

1) Allocate memory (3 bytes) for multiplicand M

2) Allocate memory (1 byte) for multiplier N

3) Allocate memory (4 bytes) for product P

4) Allocate memory (2 bytes) for P1

5) Allocate memory (2 bytes) for P2

6) Allocate memory (2 bytes) for P3

7) Read Multiplicand LSB to accumulator A (ACCA)

8) Read Multiplier to accumulator B (ACCB)

9) Multiply ACCA and ACCB (the result is saved in register D)

10) Store ACCB to Product LSB

11) Store ACCA to P1 MSB

12) Read Multiplicand MID to ACCA

13) Read Multiplier to ACCB

14) Multiply ACCA and ACCB

15) Store D register to P2

16) Read Multiplicand MSB to ACCA

17) Read Multiplier to ACCB

18) Multiply ACCA and ACCB

19) Store D register to P3

20) Read P1 MSB to ACCA

21) Add P2 LSB

22) Store sum to Product MID-L

23) Read P2 MSB to ACCA

24) Add with carry P3 LSB

25) Store sum to Product MID-H

26) Read P3 MSB to ACCA

27) Add with carry, zero

28) Store sum to Product MSB

Variable memory allocation should start at memory location $00 and the code should be stored starting at memory location $0100.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!