----- Original Message ----- From: "Jan-Erik Soderholm" Subject: RE: [PIC]Initialised data initialisation > Yes. code calling your "lookup table". Just as usual. The IDATA > directive just helps creating the RETLW instructions (I think ! ). Well, the dt directive will do that. I did a little reverse engineering and here is what I found. Using an idata directive results in (at least) three program sections. If you use one idata, you get a .cinit section, a .idata section, and a .idata_i section. The second two sections get replicated for additional (named) idata directives. The .cinit section contains data in 16 bit words, organized as 2 retlw instructions per word, low byte first. The first value contains the number of sections to initialize. For each section, there are then three words. In order, they are the address (in program memory) of the .idata_i section, the address (in GPR memory) of the .idata section, and the length of the section. The .idata_i section contains a retlw instruction for each byte to be initialized. If you name an idata section, the section names become your name, and your name _i. So b2 idata causes sections named b2 and b2_i. What isn't at all obvious to me is how to describe to the assembler the addresses of these sections. So it's not clear to me that this is even useable from assembler, at least not without manually patching in the address of .cinit. Much simpler just to use dt. --McD _______________________________________________ http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist