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.
I'm trying to use the ax51 standard macro assembler to find a way to determine if a symbol or label is already defined. Something like the following pseudo code:
if label "table_abc" is defined, do nothing, else do the following: table_abc: DB 1 DB 2 DB 3 endif
I somehow thought the following could work but alas it does not: IF NOT :DEF:table_abc table_abc: DB 1 DB 2 DB 3 ENDIF
-> LABEL NOT PERMITTED, SYNTAX ERROR
My code is 100 percent assembler code so I try to not use the C preprocessor. But if there is no other way, a C preprocessor code example would help as well.
EFM8BB31, Silicon Labs Simplicity Studio v3, Keil 8051 v9.53 debug
if a label is defined twice you shoul dget an assembler/linker error. why add Mickey Mouse stuff to catch what is already being caught?
The assembler/linker error catch is not able to decide whether additional code has to be processed or not. It only can abort the assembly. The user/developer could manually uncomment the addional code (function_abc) if the error occurs but that's not very user-friendly is it? The assembler is supposed to do it automatically.