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 there,
is it possible to read some variable (e.g. x=0 or x=1) from a *.h file and make a corresponding choice (if...else...) in the STARTUP.A66?
thanks Cheng
Runtime or compile time?
Runtime: call a C fuction (or simply read the variable) from the STARTUP.A66 file and decide based on the result.
Compile time: the includes and defines are different between asm and C but what you could do is have the build environment parse a C header file, before assembling/compiling, and generate an .inc file, that uses the assembly format, and include the generated file in STARTUP.A66.
-- Joost
Note that the so-called "C preprocessor" actually has no understanding of the 'C' language - and is not limited to just processing 'C' files.
Therefore you could use the 'C' preprocessor to do this...
Will this generate an .inc file that can be included by the assembler? Depends on the .h file I guess, if has has additional #includes or not, etc. The pre-processor might generate output containing
#line ...
Check some pre-processor output, see http://www.keil.com/support/man/docs/c166/c166_preprint.htm
-- J