RESOLVED: Jump table not working PASM
As usual I work on a problem for an hour, post then find it. The jmp #tmp1 needs to be jmp tmp1
I have used the following format for jump tables before without issue but I must be missing the forest for the trees on this one.
If in my MainLoop I do a JMP #x1 everything down stream in this cog works fine and the cogs depending on this cog also work fine.
If, however I do a JMP #NoteCommandMsg it appears that no data gets sent to the hub for subsequent processing.
Setting ChannelNum to 1 would seem to point me to "x1" in the jump table yet something is not working.
Post Edited (Wurlitzer) : 8/31/2009 4:17:30 PM GMT
I have used the following format for jump tables before without issue but I must be missing the forest for the trees on this one.
If in my MainLoop I do a JMP #x1 everything down stream in this cog works fine and the cogs depending on this cog also work fine.
If, however I do a JMP #NoteCommandMsg it appears that no data gets sent to the hub for subsequent processing.
Setting ChannelNum to 1 would seem to point me to "x1" in the jump table yet something is not working.
NoteCommandMsg
mov ChannelNum, #1
mov tmp1, ChannelNum
cmp ChannelNum, #13 wc, wz, nr
if_a jmp #MainLoop
add tmp1, #ManualNumTbl
nop
jmp #tmp1
ManualNumTbl jmp #MainLoop '0
x1 jmp #Pedal_1_Update '1
jmp #Acc_1_Update '2
jmp #Solo_1_Update '3
jmp #MainLoop '4
jmp #MainLoop '5
jmp #MainLoop '6
jmp #MainLoop '7
jmp #MainLoop '8
jmp #MainLoop '9
jmp #MainLoop '10
jmp #Pedal_2_Update '11
jmp #Acc_2_Update '12
jmp #Solo_2_Update '13
Post Edited (Wurlitzer) : 8/31/2009 4:17:30 PM GMT

Comments
setled mov tmp1, color ' get color min tmp1, #0 ' force color to legal range max tmp1, #4 ' (0 or 4 = off) add tmp1, #jmpcolor ' add to jump table nop jmp tmp1 ' jump to color mode jmpcolor jmp #ledoff jmp #ledred jmp #ledgreen jmp #ledyellow jmp #ledoff