On Sun, Nov 19, 2000 at 09:29:27PM -0500, Bob Ammerman wrote: > I should think an indirect function call would be TRIVIAL on an 18C and > rather difficult on other PIC processors: The problem arises because you want to have stuff in W, i.e. a parameter, but you can't use movff to write to pcl, so your solution ends up being the only way, but you still have to push a return address beforehand, and load the parameter into W just before the return, so it ends up messy and uses two stack levels instead of one. On the 16C devices you just write pclath then pcl, though W still has to be taken care of, on the 17C it's trivial since you can write PCL with movfp, without affecting W. If you use movff to write to PCL, it works on the emulator, but on the simulator the PC is incremented *after* it is written. The manual does say not to do it. Cheers, Clyde -- Clyde Stubbs | HI-TECH Software Email: clyde@htsoft.com | Phone Fax WWW: http://www.htsoft.com/ | USA: (408) 490 2885 (408) 490 2885 PGP: finger clyde@htsoft.com | AUS: +61 7 3355 8333 +61 7 3355 8334 --------------------------------------------------------------------------- HI-TECH C: compiling the real world. -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu