Hi > If you describe what problem you think you are solving using this, > it would be easier to tell. Ok, on receipt of an RS232 command (a single character followed by optional argument characters depending on the command), I want to 'goto' the unique handling code for each command. So I thought I'd have a table of command characters :- db "abcde",0x00. When I find a match, I use the offset of the matching command as an index in to a 'jump table' using FSR/INDF. The jump table looks like this; goto handler_a goto handler_b goto handler_c goto handler_d goto handler_e The only problem is getting the "abcde", 0x00 inititialised data table set up. Seems pointless having an idata section if I have to manually movlw, mvwf for each value. > The 628A can not directly read it's (own) Flash memory, so it > have to be RETLW instructions. Havn't tried it. Then you probably > have to "call" that "lookup table" and MOVWF your values into > the RAM space (reserved but not initialized by the IDATA driective). I got the ideas/opinions from MPASM/MPLINK docs, so I guess this doesn't necessarily apply to 16F628A? > Then you must already be using a LNK script !? > Or havn't you done *any* (non-error) build yet ? > And you don't have to "play" with it, just add the LNK > file to your project, you must do that anyway, no matter > the IDATA directive... Yes indeed I have, and all works fine; I currently usepic16f628a.lnk, NOT pic16f628a*i*.lnk - which I just found, just wondered what the difference was and if it'd help with the initialised data. I've been writing my code and running it on the simulator for a few weeks now. Just thought I'd post for any ideas/suggestions before my train journey home tonight, where I'll get my next chance to do some PIC work. > Yes. code calling your "lookup table". Just as usual. The IDATA > directive just helps creating the RETLW instructions (I think ! ). Forgive my ignorance, but how do I do this? I did notice an idata_i (or something like that) in the map file, and had a look with the program memory window at the location in the map file - I see my data there, but not in the actual file register (as expected). Actually, I think I have just realised what you refer to: the linker converts the idata stuff in to some RETLW for each byte, and I need to 'call' the relevant offset to get the value, is that right? I'm still not sure how I know what memory location to offset my 'call' from though. Cheers, Mark ============================================================================== This message is for the sole use of the intended recipient. If you received this message in error please delete it and notify us. If this message was misdirected, CSFB does not waive any confidentiality or privilege. CSFB retains and monitors electronic communications sent through its network. Instructions transmitted over this system are not binding on CSFB until they are confirmed by us. Message transmission is not guaranteed to be secure. ============================================================================== _______________________________________________ http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist