----- Original Message -----From: Paul MaddoxSent: Tuesday, May 17, 2005 11:31 AMSubject: [AVR-Chat] JumptableAll,
Is it possible to impliment a jump table based on the value read from an IO
port?
What I want is to have a 8 routines, and when the value from a port is read
(3 bit value) it jumps to the appropriate routine, I want to avoid CMP and
BREQ if possible as I need a constant length for this, using multiple
CMP/BREQs would result in a variable excution time.
Oh, I'm doing this in assembler....
Any thoughts?
I've not actually done it but it should be quite
easy: something like using the ICALL
instruction after setting the Z registers to the start of the jump table and
adding the input value to ZL. It's actually more complicated than that, but you
should get the idea.
Leon
--
Leon Heller
http://www.geocities.com/leon_heller
http://www.geocities.com/leon_heller