Easy question

Hi guys! I’ve got a little question… That’s because my lack of knowledge, so I’d appreciate any answer…

How can I use pointers in C code???

I mean: I’ ve got this in ASM code:

LDAA #BOTTOM_DISPLAY_MAP+1920

I want to that in C… How can I do it?

for example I want to point to that address with the variable var1… Is like this: var1= &BOTTOM_DISPLAY_MAP+1920???

Is it necesary to difine var1 as some special type?

Thanks

How can I use pointers in C code???

of course!

/* very generally speaking: */
unsigned char *ptr;
ptr = (unsigned char *)(BOTTOM_DISPLAY_MAP+1920);
x = *ptr; /* read from that address */

However, for more detail, look at your AVR header files and see how these things are defined (particularly register mappings, etc). For example, take a look at how some random register, say PORTB is defined.

Thanks a lot, man!!! :smiley: