Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

using codewarrior PROGRAMMING ASSIGNMENT: Write an assembly program for the Dragon12 HCS12 board to perform the following tasks and name it Lab2.asm. This program is

image text in transcribedimage text in transcribed

using codewarrior

PROGRAMMING ASSIGNMENT: Write an assembly program for the Dragon12 HCS12 board to perform the following tasks and name it Lab2.asm. This program is not really useful; it is an exercise for using addressing modes. Write the appropriate instructions in the program as stated, with the specified addressing modes. Include brief comments explaining each instruction and result. Your code should do the following:- A- In the data section 1. Define a byte variable called Counter having initial value $10 2. Define an array of words called Buffer. The array has the elements $FFFF, $33, $23B B- In the code section 3. Load the index register X with the unsigned decimal number 11783 using immediate addressing mode. 4. Load the register A with the binary data 00101111 using immediate addressing mode. 5. Store the contents of index register X at memory locations $2F00 and $2F01 using extended addressing mode. 6. Load accumulator B with the contents of memory location $2F00 using constant offset indexed addressing mode with register X. 7. Store the contents of accumulator B at memory location $2FA0 using constant offset indexed addressing mode with Y. 8. Store the contents of the accumulator A in memory location $2E07 using auto pre- increment indexed addressing mode with Y. 9. Store register A in memory location $2006 using accumulator B offset indexed addressing mode with X. 10. Load register X with the address of Counter. 11. Load register A with the content of Counter. 12. Load register B with the content of memory location $1000. Why A should equal to B? 13. Load register X with the starting address of the array Buffer. 14. Using indexed addressing mode with register X, load register Y with the first element in the array 15. Using indexed addressing mode with register X, load register Y with the third element in the array. 16. What is the difference between LDX Buffer and LDX #Buffer? PROGRAMMING ASSIGNMENT: Write an assembly program for the Dragon12 HCS12 board to perform the following tasks and name it Lab2.asm. This program is not really useful; it is an exercise for using addressing modes. Write the appropriate instructions in the program as stated, with the specified addressing modes. Include brief comments explaining each instruction and result. Your code should do the following:- A- In the data section 1. Define a byte variable called Counter having initial value $10 2. Define an array of words called Buffer. The array has the elements $FFFF, $33, $23B B- In the code section 3. Load the index register X with the unsigned decimal number 11783 using immediate addressing mode. 4. Load the register A with the binary data 00101111 using immediate addressing mode. 5. Store the contents of index register X at memory locations $2F00 and $2F01 using extended addressing mode. 6. Load accumulator B with the contents of memory location $2F00 using constant offset indexed addressing mode with register X. 7. Store the contents of accumulator B at memory location $2FA0 using constant offset indexed addressing mode with Y. 8. Store the contents of the accumulator A in memory location $2E07 using auto pre- increment indexed addressing mode with Y. 9. Store register A in memory location $2006 using accumulator B offset indexed addressing mode with X. 10. Load register X with the address of Counter. 11. Load register A with the content of Counter. 12. Load register B with the content of memory location $1000. Why A should equal to B? 13. Load register X with the starting address of the array Buffer. 14. Using indexed addressing mode with register X, load register Y with the first element in the array 15. Using indexed addressing mode with register X, load register Y with the third element in the array. 16. What is the difference between LDX Buffer and LDX #Buffer

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions