We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi,
I am mixing C and assembly and want to call assembly macros from the C file. But I do not want to define all these macros in the C file itself.
There are more than one such C files and a few asm files as well which use these set of macros.
Ideally I would want to place the macros in as assmebly inc file and then include this file in the C file. But I was told in one of my previous threads that it is not possible to do so.
Can you suggest me any clean method by which I can do this?
Regards, Gaurav
"I am mixing C and assembly"
It is generally a bad idea to try to mix C and assembly at the Source level - far better to keep your 'C' source and assembler source separate, and make function calls between them.
"want to call assembly macros from the C"
You can't do that. Assembler macros expand to assembler source - so the 'C' compiler won't understand them.
See: http://www.keil.com/forum/docs/thread10004.asp
Also: http://www.keil.com/forum/docs/thread1035.asp
"I was told in one of my previous threads that it is not possible to do so."
http://www.keil.com/forum/docs/thread10004.asp
So why have you started a new thread with the same question?!
Why didn't you follow the advice given there; viz, to use the assembler's ability to understand some 'C' preprocessor syntax?
Again, see: http://www.keil.com/support/man/docs/a51/a51_mp_c.htm
See also: www.8052.com/.../read.phtml