Can conditional assembly controls be used externally? In other words, I have a set of assembly-time options that I select in the "application-level" portion of my assembly code. I'm trying to have one of the options, "LOW_SENSITIVITY_MICROPHONE", control which portion of code in a *separate module* gets assembled. For example, in my application-level code, I have: PUBLIC LOW_SENSITIVITY_MICROPHONE $SET (LOW_SENSITIVITY_MICROPHONE = 1) ...and in a separate module I have: EXTRN NUMBER (LOW_SENSITIVITY_MICROPHONE) $IF (LOW_SENSITIVITY_MICROPHONE) CODECMICREGEARPCS_LO EQU 0F1h $ELSE CODECMICREGEARPCS_LO EQU 91h $ENDIF However, when I try to assemble, I get an error of an undefined symbol on the line where I'm trying to declare LOW_SENSITIVITY_MICROPHONE as public. Is what I'm trying to do even possible? Thanks. Drew Rainwater
you need condition triggers ("operands" for IF etc) in .h or .inc files that uyou include in every .a51 or .c module that access them. erik
I think I see... So, in the (re-usable) module that actually wants to use the LOW_SENSITIVITY_MICROPHONE option to decide which portions of code to assemble, I need to allow for a "setup" file to be included by adding: $include (C:\setup.inc) ...and then my application-level code would supply this file with LOW_SENSITIVITY_MICROPHONE either true or false as needed. Sound right?
yes
there actually is another way, since you say "reusable" which smell "library" compile mic1.c with the IF condition =1 compile mic2.c with the IF condition =2 .... the in the "user of the reusable" have if cond == 1 call mic1 elseif mic = 3 call mic2 .... Erik