Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Software interrupts have many uses in programing including implementing operating system (OS) calls, implementing break points, implementing single step more and also implementing new (macro)

Software interrupts have many uses in programing including implementing operating system (OS) calls, implementing break points, implementing single step more and also implementing new (macro) instructions. The HC11 microcontroller does feature software interrupt instruction SWI. The SWI instruction saves all registers on the stack, and then branches to the address stored in the interrupt vector stored at address $FFF6-FFF7. For full description of the SWI instruction, including the order it saves the registers on the stack, check the HC11 documentation on the web (e.g. http://cache.freescale.com/files/microcontrollers/doc/data_sheet/MC68HC11A8.pdf ).
QUESTION?
Write the SWI interrupt servicing routine that would provide the following functionality: invoking the SWI instruction should result in swapping (exchanging) the contents of the Accumulator A with the contents of Accumulator B. For example, the following program:
LDAA #1
LDAB #2
SWI
NOP
when reaching the NOP instruction should result in having 1 stored in Accumulator B and 2 stored in Accumulator A. (Hint: the implementation involves moving data stored on the stack. Do not forget to initialize the stack pointer (SP) and to initialize the SWI instruction interrupt vector stored at address $FFF6-FFF7.)
Test your program using the Wookie simulator. Submit .lst file and a screen shot of the simulator showing the result of running the program.

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_2

Step: 3

blur-text-image_3

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

Question

=+ a. Which account would you prefer? Why?

Answered: 1 week ago