piclist 2003\06\05\050934a >
Thread: Call a function address by variable value
face BY : Amir Shalem email (remove spam text)

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

       ;do something

In C, its easy to do

void function() { return; }

typedef void (*ptr) (void);

void start() {
       ptr *pointer;

       pointer = function;

is it possible to do in SX asm ?


http://www.piclist.com hint: To leave the PICList

See also: www.piclist.com/techref/ubicom/devices.htm?key=sx
Reply You must be a member of the piclist mailing list (not only a www.piclist.com member) to post to the piclist. This form requires JavaScript and a browser/email client that can handle form mailto: posts.
Subject (change) Call a function address by variable value

month overview.

new search...