Question: 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

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!