So how would I create a jump table in ASM?
If it helps, here is how I am hoping to have the program run:
1) Start up- set configureation bits, clear all outputs, establish inputs and outputs
2) send a "Hello" message to the LCD
3) send a "Mode:" message to the LCD
4) check keypad for mode number- branch to specified mode number
5) send a "Rate:" message to the LCD
6) check keypad for rate number- store as an interupt counter for timer 0
7) send a "Output:" message to the LCD (followed by a series of X's to indicate which LEDs are on)
8) execute a NOP until an interupt occurs
9) on a key pad interupt, get the new key value (timer 0 is a high priority interupt, while key pad is a low priority)
10) on a timer 0 interupt, change the state of the LEDs based on the specified mode (if the interupt counter is 0 then it changes state and resets the interupt counter, if it's not 0 then it decrements it once and returns)
11) return from last interupt and continue
12) loop forever
What I am most concerned about is if the timer0 interupt occurs, it will still have to look which mode to branch to in the table since I can't have a different high priority interupt before each mode routine.