Hello
I am not familiar with IAR front-end. However defining your variable as follows is fully ANSI C compliant, so IAR compiler should support that too:
#define data (*((char *) 0x0170))
You can then initialize this variable in following way:
data = 8;
CrasyCat
The way CrazyCat described is what IAR themselves use (see IO6811.H for example), and it works fully in my programs.
What error do you get?
I do not understand why you would need a pointer to be in a specific position (and not point to a specific position), but here is a way to do it:
#define data (*((char *) 0x170)) // define a variable at address 0x170
#define pdata (*((char **)0x172)) // define a pointer to a char at address 0x172
data = 8; // the char at 0x170 will be set to 8
pdata = (char *) 0x170; // the pointer at 0x172 will be set to 0x170
*pdata = 8; // the char pointed to by 0x172 is set to 8 (same as data = 8)