Document Navigation
Table Of Contents
Previous
Next

II. GETTING THE SYSTEM STARTED

The disk version of the 6809 Mnemonic Asssembler is very simple to use. There are no built-in editing functions - you must have a previously edited source file on disk before using the assembler. This file must be a standard FLEX text file which is simply textual lines terminated by a carriage return. There should be no line numbers or control characters (except for the carriage returns) in the file. When you have both the assembler and the edited source file on a disk or disks which are inserted in a powered up system, you are ready to begin.

The Command Line

The very minimum command line necessary to execute an assembly is as follows:

+++ASMB,<filename>

The three plus signs are FLEX's ready prompt, ASMB is the name of the assembler file (it has a .CMD extension), and the <filename> is the standard FLEX specification for the source file you wish to assemble. The <filename> defaults to a .TXT extension and to the assigned working drive if an explicit extension and drive number are not given. In this and forthcoming example command lines, a comma is used to separate items. It is also possible to use a space or spaces in this capacity.

As stated, this is the very minimum command which can be used. It is possible to supply many more parameters or options to the assembler, but if left off as in this example, the assembler will assume default parameters. Perhaps the most important options available are the two associated with output. We say two because there are two types of output available from the assembler: object code output and assembled source listing output. The options regarding the assembled source listing output will be described a little later.

The object code can be in the form of a binary disk file, a hex output to tape, or no object code output at all. Since no specifications are made concerning object code output in the above example, the assembler will assume the default case which is a binary disk file. Since no name was specified, the output binary file will assume the same name as the input source file specified but with a .BIN extension. If such a file already exists, you will be asked:

DELETE OLD BINARY (Y-N)?

to which you may respond 'Y' which will delete the existing file and continue to create the new file or 'N' which will immediately terminate the assembly, returning to FLEX with the old binary file remaining intact.

If you wish to create a binary file by another name or extension, you may do so by placing the desired file specification on the command line as follows:

+++ASMB,<input file spec>,<binary file spec>

This binary file specification will default to a .BIN extension and to the assigned working drive. If a file by that name already exists on the specified drive, you will be prompted as described above.

Specifying Assembly Options

Now we shall go one step further and add a set of single character option flags which may be set on the command line as follows:

+++ASMB,<input file spec>[,<binary file spec>][,+<option list>]

The square brackets indicate that the binary file spec and the option list are optional. The plus sign is required to separate the option list from the file specifications. The <option list> is a set of single character flags which either enable or disable a particular option. In all cases they reverse the sense of the particular option from its default sense. There may be any number of options specified and they may be specified in any order. There may not be spaces within the option list. Following is a list of the available options and what they represent:

OptionDescription
BDo not create a binary file on the disk. No binary file will be created even if a binary file name is specified. This is useful when assembling a program to check for errors before the final program is completed or when obtaining a printed source listing.
LSuppress the assembled listing output. If not specified, the assembler will output each line as it is assembled in pass 2, Those lines containing errors will always be printed regardless of whether or not this option is specified.
SSuppress the symbol table output. The assembler normally prints out a sorted symbol table at the end of an assembly. This option suppresses that output. Note that the L option will not suppress the symbol table output, just the source itself.
GTurns off printing of multiple line object code instructions. Certain directives (FCB, FDB, and FCC) can produce several lines of output listing for only one instruction line. This option prints the first line of output from such an instruction (the line which contains the source) but suppresses the printing of the subsequent lines which contain only object code information.
NEnables the printing of decimal line numbers on each output line. These numbers are the consecutive number of the line as read by the assembler. Error lines are always output with the line number regardless of the start of this option.
TProduce a hex output directly to tape. This output is formatted in the standard Motorola 'S1-S9' format. Consult the section on object code production for further details.
YThis option overrides the prompt for deleting an existing binary file. In other words, if the Y option (stands for YES) is specified, an existing binary file of the same name as the one to be created will be automatically deleted without a prompt.
DSuppress printing of the date in the header at the top of each output page. The assembler normally picks up the current date from FLEX and prints it in the header. This option causes the date to be omitted.
WSuppress warning messages. The 6809 assembler is capable of reporting a number of warning messages as well as an indicator of long jumps and branches that could be shortened. This option suppresses the printing of these messages and indicators.
P<no>This option allows the programmer to specify a page number at which to start printing of the assembled listing. Complete instructions can be found in the next paragraph.

Specifying a Starting Page Number

As mentioned in the 'P' option above, it is possible to specify a particular page number at which printing of the assembled listing should commence. All output before that page is suppressed INCLUDING ERROR LINES! When the specified page is hit, printing begins and continues to the end of the assembly. Note that it is possible to suspend or to completely terminate an assembly during output by use of the escape or escape/return sequence found in FLEX. The desired page number is specified right with the 'P' option in the option list. It must directly follow the 'P' and should be a decimal number from 1 to 65,536. The page number itself must be directly followed by a non-alphanumeric character (terminator) such as a comma or space. This implies that the 'P' option, if specified, MUST BE THE LAST OPTION SPECIFIED. The page number may also be followed or terminated by a plus sign as used in the following paragraph. It is also important to note that the PAG mode must be selected (pagination turned on) in order for the 'P' option to have any effect. The PAG mode may be turned on as described in the section on Standard Directives.

COMMAND LINE PARAMETERS

The assembler has a facility for passing information from the command line directly into the source program. A maximum of three pieces of information or "command line parameters" may be passed to the program. These parameter are simply strings of characters that will be substituted into the source listing as it is read in by the assembler. These parameters are expressed in the command line in the manner shown here:

+++ASMB,<in file>,<binary file>,+<options>,+<prm.l>,<prm.2>,<prm.3>

The parameters are optional but must be separated from the rest of the line by the second plus sign and from each other by commas. As stated, these parameters are simply strings of characters. They may be supplied in two ways: as a string of characters enclosed by a delimiter or just a string of characters with no spaces or commas embedded. The "delimiters" which can be used to enclose a string are the single quote (') and the double quote ("). Either can be used but for a particular string the beginning delimiter and the ending delimiter must be the same. The reason for using a delimited string is to pass in a string with commas and/or spaces which cannot be in an un-delimited string. Note that if one wishes to enter a command line parameter but no options, he must still place both plus signs in the command as seen in this example command line:

+++ASMB,ANYFILE,++PARAMETER1,PARAMETER2

For further information on command line parameters and how to specify where in the source program these parameters should be substituted, see the section on Special Features.

OUTPUTTING TO A HARDCOPY DEVICE

The assembler does not have a built in means for outputting the assembled listing to a hardcopy device. This operation is, however, available through the facilities of FLEX. To do so one must use the 'P' command provided with FLEX. This 'P' command reads a printer driver file which you can supply to output to any hardcopy device you want. It effectively switches the output of the assembler from going to the terminal to going to the printer. For example:

+++P,ASMB,TESTFILE

would cause the assembled listing of the source file TESTFILE.TXT to be output to the printer. For further details of use of the 'P' command the FLEX User's Manual and Advanced Programmer's Guide.

EXAMPLES:

ASMB,TEST
Assembles a file called TEST-TXT on the assigned working drive and creates a binary file called TEST.BIN on the same drive. The assembled listing is output to the terminal as is the symbol table.

ASMB,TEST,+LS
Same as before except that no listing is output (except for any lines with errors) and no symbol table is output.

ASMB,0.TEST,1.TEST.CMD,+LSY
Assembles a file from drive 0 called TEST.TXT and produces a binary file on drive 1 called TEST.CMD. No listing or symbol table is output and if a file by the name of TEST.CMD already resides on drive 1, it will be automatically deleted before the assembly starts.

l.ASMB,0.TEST.BAK,+BNGS
Loads the assembler itself from drive 1 and assembles a file called TEST.BAK found on drive 0. No binary file is produced. The assembled listing is output with line numbers turned on and multiple line generated code turned off. No symbol table is printed.

ASMB,0.TEST.BAK,+GSBNP26
This command performs just like the last with two exceptions. First, the assembler itself is loaded from the whatever the assigned system drive is. Second, the assembled listing output does not begin until the assembler reaches page number 26.

0.ASMB,0.ASMB,0.ASMB,+GW,+MINI,'ASSEMBLER FOR 5" DISK'
This command looks a little confusing, but it was done to accentuate the method in which default extensions work. The assembler itself (a file called ASMB.CMD) is loaded from drive 0, the file called ASMB.TXT found on drive 0 is assembled, and a binary file is produced on drive 0 by the name ASMB.BIN. Note that it was not necessary to specify the binary file name in this case since ASMB.BIN is what the default would have been. The assembled listing is output with multiple line code generation suppressed and warning messages suppressed. There are two parameters which may be passed into the source listing. The first is the single word 'MINI'. The second parameter is the entire string, 'ASSEMBLER FOR 5" DISK', excluding the single quote delimiters (everything starting with the A and ending with the K).


Table Of Contents Previous Next
Document Navigation