Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to use conditional compile #define KKKKK for a project with both asm and C files?

Status
Not open for further replies.

emmos

Member level 2
Joined
Dec 30, 2003
Messages
47
Helped
3
Reputation
6
Reaction score
1
Trophy points
1,288
Activity points
472
Hi Everybody

I have a program and I am using the conditional compile #define KKKKK

the problem is that I want to use it in the project with .asm files and C files

I tried using a common file and include it but it either worked on the asm or C files

what can I do to fix it?

thanks
Emmos
 

Re: conditional compile

the #define KKKKK is just a part of it. Somewhere in your code you should have something that says

#ifndef KKKKK

do something

#endif
 

Re: conditional compile

Yes I have in there I have
#ifdef KKKK

#endif

but if I do a .asm file with the #defineKKKK the .c doesn't recognize it and vice versa (I have one asm file and one C file in the program)

thanks
 

Re: conditional compile

this will depend on which compiler you have. If they were both c modules you would do the # deine in a header so that both would see it. If your compiler can compile c file and generate an asm file from it try the following:

Create 2 c files. # define in the header and do the #ifdef in each c file with some dummy code. Compile and generate the asm listing. Take a look at listing to see how compiler does it
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top