Oct 11, 2011
11:49 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oct 11, 2011
11:49 AM
Hi,
I have an array defined in C:
char return_data[32];
I need access to this from an asm routine. What do I need to add to the .asm file to inform the compiler / linker of the existence of return_data ?
Many thanks
Hugo
Labels
- Labels:
-
PSoC 1
1 Reply
Oct 15, 2011
02:14 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oct 15, 2011
02:14 AM
If you want to access any of the C variables from assembly then you have to use "_" in front of their name. For accessing any array you can use indexed addressing mode, here is an example for the same.
For accessing an array from assembly, X will point to the index.
RAM_SETPAGE_IDX >_MyBufferName ; This instruction is required when your device have more than one page of RAM and paging is enabled.
mov A, [X + _MyBufferName]
inc / dec X