Download FLEX 6809 Relocating Assembler
Transcript
FLEX 6809 Relocating Assembler Command Line Parameters In the section on using the assembler at the beginning of this manual, command line parameters are discussed. That section describes how to place a parameter on the command line for passing into the source, but it does not elaborate on how the programmer tells the assembler where in the source to substitute those parameters. If you have read the section on macros, you should already understand the concept of parameter substitution. If not, read that section before continuing here. Much as in macro parameter substitution, there are 2-character symbols or dummy parameters which, if placed anywhere in the source, will be replaced by the parameters supplied on the command line. In macros, the parameters from the macro calling line were substituted into the macro body during expansion of the macro. Here, the parameters from the command line are substituted into the source as it is read in from the disk. In macros, there were 10 possible parameters. Here there are three possible. The 2-character dummy parameters for these three are ’&A’, ’&B’, and ’&C’. These correspond to the three possible command line parameters represented here: +++RELASMB,<filename>,+<options>,+<prm.A>,<prm.B>,<prm.C> As can be seen, the three parameters are separated by commas. Just as in macros, the dummy parameters can be ignored by placing a backslash directly in front of the ampersand. Thus the following line of edited source: VALUE EQU MASK\&COUNT would be read into the assembler as: VALUE EQU MASK&COUNT A quick example should help clarify the preceding descriptions. following program contains one dummy parameter, ’&A’. * ROUTINE TO OUTPUT TO ONE OF TWO PORTS OPT PAG,CON TTL OUTPUT ROUTINE FOR PORT #&A PAG IFN (&A=0)|(&A=l) ERR NOT A VALID PORT NUMBER ELSE IF &A=0 ACIA EQU $E000 ELSE ACIA EQU $E004 ENDIF ENDIF -65- The