> When you declare data structures you have to tell the compiler if they > are located in program memory or in data memory. You then have a handy > pointer that can work with either type of data. Obviously it is a > pointer to a const data type, so the data cannot be modified via that > pointer even if it is in data memory. The whole idea is that a function > using this pointer dosen't have to be explicitly told where the data is, > it just works. Wheres the problem exactly? > > Regards > > Mike The problem is that unlike on a PC, for example, the machine language instructions to access the data in program memory and in data memory are completely different one from the other. Depending on the PIC, program memory accesses can be done by using RETLW instructions to define a table, or via some sort of 'Table Load' instruction. Accessing data memory on the other hand requires the pointer to be moved into an FSR (and possibly IRP bits). Constantly checking which is which at runtime is terribly inefficient. If I wanted that level of performance I'd use Basic ;-) Yech! Bob Ammerman RAm Systems -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist