Arm Community
Site
Search
User
Site
Search
User
Groups
Arm Research
DesignStart
Education Hub
Graphics and Gaming
High Performance Computing
Innovation
Multimedia
Open Source Software and Platforms
Physical
Processors
Security
System
Software Tools
TrustZone for Armv8-M
中文社区
Blog
Announcements
Artificial Intelligence
Automotive
Healthcare
HPC
Infrastructure
Innovation
Internet of Things
Machine Learning
Mobile
Smart Homes
Wearables
Forums
All developer forums
IP Product forums
Tool & Software forums
Support
Open a support case
Documentation
Downloads
Training
Arm Approved program
Arm Design Reviews
Community Help
More
Cancel
Developer Community
Tools and Software
Software Tools
Jump...
Cancel
Software Tools
Arm Development Studio forum
C headers in assembly
Tools, Software and IDEs blog
Forums
Videos & Files
Help
Jump...
Cancel
New
Replies
3 replies
Subscribers
126 subscribers
Views
2008 views
Users
0 members are here
Related
C headers in assembly
Offline
Rohan Gandhi
over 7 years ago
Note: This was originally posted on 5th April 2011 at http://forums.arm.com
Hello!
I am facing a problem while including a C header in the assembly.
My assembly code is as follows -
#include "header01.h"
.syntax unified
.text
.thumb
/* uint8 mycode_func(void) */
.global mycode_func
.func mycode_func, mycode_func
.type mycode_func, %function
.thumb_func
mycode_func:
mov R0, #MY_CONSTANT
.endfunc
header01.h has -
#define MY_CONSTANT 10
This code gives an error - undefined symbol MY_CONSTANT.
If I change mov R0, #MY_CONSTANT to mov R0, 10, it works well.
What do I need to do to get this to work?
Thanks in advance!!
Parents
Offline
Scott Douglass
over 7 years ago
Note: This was originally posted on 5th April 2011 at
http://forums.arm.com
You need to have the assembler run the preprocessor over the input file first. I think the usual way to get this done by GNU tools is to name the file 'foo.S' instead of 'foo.s'. Possibly you need to build it using gcc, for example: 'gcc -c foo.S'. There's probably also an option to the assembler to force the preprocessing.
Cancel
Up
0
Down
Reply
Cancel
Reply
Offline
Scott Douglass
over 7 years ago
Note: This was originally posted on 5th April 2011 at
http://forums.arm.com
You need to have the assembler run the preprocessor over the input file first. I think the usual way to get this done by GNU tools is to name the file 'foo.S' instead of 'foo.s'. Possibly you need to build it using gcc, for example: 'gcc -c foo.S'. There's probably also an option to the assembler to force the preprocessing.
Cancel
Up
0
Down
Reply
Cancel
Children
No data
More questions in this forum
By title
By date
By reply count
By view count
By most asked
By votes
By quality
Descending
Ascending
All recent questions
Unread questions
Questions you've participated in
Questions you've asked
Unanswered questions
Answered questions
Questions with suggested answers
Questions with no replies
Answered
How to view SFRs in DS during debugging?
+1
2878
views
1
reply
Latest
3 months ago
by
Ronan Synnott
Answered
Dual-core debugging in DS
0
5733
views
2
replies
Latest
3 months ago
by
Ivan Savvateev
Answered
DS52020.0 connection to Musca-A/B boards not working
+1
Arm Development Studio
Musca-A
7529
views
4
replies
Latest
3 months ago
by
Daniel Oliveira
Answered
Positioning a function in a Position Independent Executable for ARMV8
+1
8285
views
3
replies
Latest
4 months ago
by
Stephen Theobald
Answered
Link a pure binary file to image with scatter file
0
8248
views
3
replies
Latest
4 months ago
by
Ronan Synnott
<
>
View all questions in Arm Development Studio forum