Arm Community
Site
Search
User
Site
Search
User
Support forums
Arm Development Studio forum
give C struct to assembler...
Jump...
Cancel
Locked
Locked
Replies
7 replies
Subscribers
118 subscribers
Views
11100 views
Users
0 members are here
Options
Share
More actions
Cancel
Related
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion
give C struct to assembler...
Etienne SOBOLE
over 12 years ago
Note: This was originally posted on 24th November 2011 at
http://forums.arm.com
how can I send the offset of a C struct to en assembly code ? For example
In my C code I have
typedef struct
{
unsigned int a;
unsigned int b;
} CMyStruct;
I send to an ASM function a pointer of a CMyStruct structure Let suppose that my pointer is into R0
To access to a and b attribute I need to do that.
ldr r1, [r0, #0] // read a
ldr r2, [r0, #4] // read b
Is there anyway to not specify #0 and #4 as contant value ? Something like
ldr r1, [r0, CMyStruct.a] // read a
ldr r2, [r0, CMyStruct.b] // read b
Thank's Etienne
Parents
Etienne SOBOLE
over 12 years ago
Note: This was originally posted on 25th November 2011 at
http://forums.arm.com
For RVCT, the answer is (Example) 42 in "Using the Compiler ":
http://infocenter.ar...f/Chdcceie.html
Thank you, but in fact there is 2 problems:
1 - I'm using gcc
2 - I only make standalone assembly code.
I suppose there is no solution to my problem !
Cancel
Vote up
0
Vote down
Cancel
Reply
Etienne SOBOLE
over 12 years ago
Note: This was originally posted on 25th November 2011 at
http://forums.arm.com
For RVCT, the answer is (Example) 42 in "Using the Compiler ":
http://infocenter.ar...f/Chdcceie.html
Thank you, but in fact there is 2 problems:
1 - I'm using gcc
2 - I only make standalone assembly code.
I suppose there is no solution to my problem !
Cancel
Vote up
0
Vote down
Cancel
Children
No data