Corrections below. Sorry! ----- Original Message ----- From: Bob Ammerman To: Sent: Sunday, November 19, 2000 9:29 PM Subject: Re: [PIC]: 16C76/CCS vs. 18C252/Hi-Tech > > Indirect function calls have proved to be particularly difficult > > on the 18C, fortunately they are not something that gets used a > > lot. > > I should think an indirect function call would be TRIVIAL on an 18C and > rather difficult on other PIC processors: > > given: > > void f(void) > { > } > > void (*g)(void); // g is a pointer to a func > > // Assign pointer to variable > g = f; > > movlw low(f) > movwf _g > movlw high(f) > movwf _g+1 > > // Call thru pointer: > (*g)() > > call call_thru_g > > call_thru_g: > push > movf _g,w > movwf tosl > movf _g+1,w > movwf tosh > return > > Bob Ammerman > RAm Systems > (contract development of high performance, high function, low-level > software) > > -- > http://www.piclist.com hint: The list server can filter out subtopics > (like ads or off topics) for you. See http://www.piclist.com/#topics > > -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics