One easy way is with jump tables. Works something like this: mov ptr, [function number] mov w, < > is it possible in SX to do CALL or JMP to an address specficed in a > variable ? > > something like this: (this doesn't work) > > callback EQU $08 > reset start > > start mov callback, myfunction > call callback > > myfunction > ;do something > ret > > In C, its easy to do > > void function() { return; } > > typedef void (*ptr) (void); > > void start() { > ptr *pointer; > > pointer = function; > (pointer)(); > } > > is it possible to do in SX asm ? > > thanks, > Amir. > > -- > http://www.piclist.com hint: To leave the PICList > mailto:piclist-unsubscribe-request@mitvma.mit.edu -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu