In this exercise you will use output compare interrupts to


When a debugger wishes to single-step a program that exists in RAM, it can replace opcodes one at a time with SWI (it will have to replace two opcodes when single-stepping a conditional branch). This approach is not feasible when testing software stored in ROM or PROM. In this exercise you will use output compare interrupts to implement single-step debugging. Your approach will work for programs in RAM or ROM.

a) Write a debugging function that initializes the OC5 interrupt then calls the User Routine. The first OC5 interrupt should occur after exactly one instruction of the User Routine has been executed. You may assume the User Routine has no I/O parameters. You may also assume that User Routine has no interrupts of its own and it does not disable interrupts. When the User Routine returns back to your function, you should shut off OC5. You can start with the following syntax and add the OC5 code. You may write your answer in assembly or C.

1925_9fd934e0-7950-4575-839e-7b872f3913be.png

b) Write the OC5 interrupt handler that calls Display then Get Char. In a real debugger we would process the keyboard input and interact with the user, but in this simple solution the keyboard input is used only to pause. Before returning from the interrupt, you should set up OC5 so that the 9S12 will execute exactly one more instruction of User Routine before another OC5 interrupt is generated

Request for Solution File

Ask an Expert for Answer!!
Mechanical Engineering: In this exercise you will use output compare interrupts to
Reference No:- TGS01468274

Expected delivery within 24 Hours