Michael Rigby-Jones wrote: > /* Jump table entry macro - target dependant */ > #define TB_ENTRY_FAR(addr) __asm__ __volatile__ ("jmp " addr : : ) >=20 > void JumpTable (void) > { > // FAR format (each entry 2 words) > TB_ENTRY_FAR("MyFunc1"); // quotes are necessary > TB_ENTRY_FAR("MyFunc2"); > TB_ENTRY_FAR("MyFunc3"); > TB_ENTRY_FAR("MyFunc4"); > TB_ENTRY_FAR("MyFunc5"); > } OK, in this case, MyFunc1, etc. are the addresses of the actual functions, used as arguments to the jmp instructions. > And then I define the pointers to the actual function. JT_BASE is defined= by > the makefile, so I only have to change this in one place if I ever needed= to > move it. >=20 > #define MyFunc1 (a) ((fp_u8_pu8)(JT_BASE+0))(a) > #define MyFunc2 () ((fp_s16_v)(JT_BASE+2))() > #define MyFunc3 (a) ((fp_b_u8)(JT_BASE+4))(a) > #define MyFunc4 (a) ((fp_v_b)(JT_BASE+6))(a) > #define MyFunc5 () ((fp_pu8_v)(JT_BASE+8))() This doesn't look right. These are pointers into the jump table, not pointe= rs to the actual functions. These are meant to be used in the application code= , aren't they? As such, shouldn't they should use a different set of names, rather than MyFunc1, etc. (e.g., JTFunc1, etc.)? -- Dave Tweed --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .