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

C headers in assembly

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!!