Thanks Veronica, works a treat. I guess that is the way to inform the compiler that I really want to do this and is not a mistake. Cheers Justin On 6 July 2010 14:11, Veronica Merryfield wrote: > *((char*)0x0F8F) = 0xff; > > Or > > char *addr; > > addr = (char*)0x0f8f; > > *addr = 0xff; > > > > On 2010-07-05, at 10:44 PM, Justin Richards wrote: > > > In MCC18 I can do > > > > LATG = 255; > > > > in P18F97J60.INC there is > > > > LATG EQU H'0F8F' > > > > and in P18F97J60.h there is > > > > extern volatile near unsigned char LATG; > > > > Ideally I would like reference registers by address something like this > > > > char *addr; //create a pointer that points to registers > > > > addr = 0x0F8F; //location of LATG > > *addr = 255; // put this value into location 0X0F8F > > > > but the compiler complains > > > > C:\MPLAB\MyMCHPTCP\src\pom_HTTPExecCmd.c:200:Error [1131] type mismatch > in > > assignment > > > > in this line > > > > addr = 0x0F8F; //location of LATG > > > > One may ask why I would want to do this but I want to be able to access > > registers by address. > > > > Cheers Justin > > -- > > http://www.piclist.com PIC/SX FAQ & list archive > > View/change your membership options at > > http://mailman.mit.edu/mailman/listinfo/piclist > > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist