"ifdef" in PowerPC assembly

I want to do an ifdef condition in assembler similar to Pre-processor in C.

eg:

ifdef UNIT_TEST
b somewhere
else
b somewhere else

      

I am using PowerPC e200z6 core.

+3


source to share


1 answer


Usually (and this is what we do in the powerpc part of the Linux kernel), we get a C preprocessor to preprocess ASM files for us:

#ifdef UNIT_TEST
b test
#else
b work
#endif

      



Typically these files are marked with .S

instead of .S

or .asm

to indicate that they are preprocessed.

+6


source







All Articles