- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
My firmware is mainly written in assembly with some c-functions included. To have several similiar products covered I use conditional source in assembly.
Now I need to use on condition as well in assembly as in C, using the precompiler.But, it seems impossible to use a constant defined by "equ" in assembly in C-Code.
Is there a way to do that, or do I have to define the constant a second time in C-code using "#define"?
Thanks for any hints!
- Labels:
-
PSoC 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
C and assembler can only commun icate via the linker to each other. So neither a #define in C nor an EQU in asm will be seen by the other.
Bob (feeling bad to spread bad news)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Found this to be interesting -
http://www.psocdeveloper.com/forums/viewtopic.php?t=5679&f=45
Looks like you could use conditionals in C to effect asm, although that was not the
topic of the link.
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Depending on the compiler you use....
For HI-TECH, you should declare your variable in C like:
unsigned int foo;
And use it in assembly using:
clr [_foo+1],7
rrc [_foo+1]
Regards,
Rolf