SparkFun Forums 

Where electronics enthusiasts find answers.

Your source for all things Atmel.
User avatar
By SebaS
#20225
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
By andrey
#20235
How can I use pointers in C code???
of course!
Code: Select all
/* 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.
User avatar
By SebaS
#20398
Thanks a lot, man!!! :D
long long title how many chars? lets see 123 ok more? yes 60

We have created lots of YouTube videos just so you can achieve [...]

Another post test yes yes yes or no, maybe ni? :-/

The best flat phpBB theme around. Period. Fine craftmanship and [...]

Do you need a super MOD? Well here it is. chew on this

All you need is right here. Content tag, SEO, listing, Pizza and spaghetti [...]

Lasagna on me this time ok? I got plenty of cash

this should be fantastic. but what about links,images, bbcodes etc etc? [...]