This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

local labels in HET assembler



Hi,

How do I declare local labels in HET assembler? I am using macros, and to avoid multiple statements with the same label, I use question marks to generate unique labels. The HET assembler handles it, but the generated .h file is not usable because it contains dots in the C macro names for the labels. Example:

#define HET_L0.16_0 (e_HETPROGRAM0_UN.Program0_ST.L0.16_0)

#define pHET_L0.16_0  77

#define HET_L1.16_0 (e_HETPROGRAM0_UN.Program0_ST.L1.16_0)

#define pHET_L1.16_0  78

So how can I prevent a label from being exported to the ".h" file?

Thanks and Best Regards,

 

Daniel Marmier

  • Daniel,

    I would recommend avoiding macros in the HET assembler except for perhaps in equate statements.

    They work but they don't play well with the other tools.   For instance if you use Macros to instantiate copies of a function, then try to debug this code in the HET IDE,  the HET IDE only shows you one instance of the macro.   The rest of the code is 'there' but it's not got labels and looks like junk at the end of your program.

    What I've been doing lately is using an external macro preprocessor to expand the HET IDE code from macros to a .het file, and then I've been working with this expanded file.    If you do that too you will not only avoid the problem you see now but you'll have something that is easy to debug in the HET IDE. 

    I could not find an option for the HET assembler to simply output the preprocessed file without assembling it as well.   So I wound up switching to GNU M4 as a macro processor.   That gives complete control over the generated code and there's no local label issue.


    I'd recommend you find a standalone macro processing (or scripting) tool like M4 or Python and use this to expand your HET code fully before running it through the HET assembler and working with it in the HET IDE.