It looks at the .asm file output for any sub, register, event, and system library usage of interest and reports on what it finds.
To use it, first comment out any existing 'save/restore' statements and compile your program.
Run IsrContext.exe, click the 'Open file...' button, browse to the .asm file location, select the file, and click 'Open'.
The analysis will run and you'll get a report similar to what's shown above...
Code: Select all
//==================================================================================================
HIGHP_ISR isr usage summary: PRODL PRODH
hdw shadow: 1
context save: 'save(PROD)'
//==================================================================================================
It's pretty straight forward for most situtations, but if your program uses events there's a little more work involved.
Events are a form of indirect subroutine call and are setup at runtime by your code. Because of this the analyzer can't know for certain what event routines are being used where so it'll analyze all the events in your program and show the context for each event.
If events are flagged as being used in the isr summary, you have to combine the isr 'save' with the 'save' statement for the proper event.
I'm going to see if I can improve on this (and for many cases I probably can) but there will be situations where this is as good as it gets.
The program even works with vectored interrupt mode and IVT.bas, but you have to deal with the same event limitations since IVT.bas defines all ISR routines as events.
If you use it I'd appreciate any feedback since there are bound to be some situations I didn't consider.
IsrContext v0.1.0: