@NewPage @Section(EUCSD MOTOROLA M6809 ASSEMBLER) This assembler is a local implementation of the Motorola M6809 cross assembler. This is basically documented in the 'M6800 Microprocessor Programming Manual' with the extensions for the M6809 described in the 'M6809 Advance Information' data sheet. Wherever possible it is upward compatible with the Motorola assembler and like it, contains no macro facilites. @SubSection(Differences) @Paragraph(Restrictions) @Begin(enumerate) Only one program may be assembled in a single input stream. As a result the MON and END directives are synonymous and optional. Only object tapes are produced by the assembler. As a result the OPT directive options MEMORY and OTAPE and their variants are illegal. Error messages are of a different and fixed form and hence the OPT directive options SERROR and SER are synonymous with ERROR. @end(enumerate) @Paragraph(Extensions) @Begin(enumerate) The delimited form of the FCC directive accepts the doubled delimiter as a single instance of the delimiter in the generated text. @Begin(Fileexample) e.g. FCC /A//B/ is the same as FCC 'A/B' @end(Fileexample) The OPT directive has the following additional options: @Begin(Fileexample, LeftMargin +2) Long form Short form BLANK B Ignores redundant spaces in operand field. e.g. around ',' and '+'. NOBLANK NOB No spaces allowed in operand field (selected by default). CYCLE C Print execution time in machine cycles for each executable statement. NOCYCLE NOC No execution times printed (selected by default). FULL F Allows fully parenthesised arithmetic expressions as operands (see (3) below). NOFULL NOF Only unparenthesised expressions evaluated strictly from left to right are allowed as operands (selected by default). WRAP W Long input lines are wrapped around on to next line of listing. NOWRAP NOW Long input lines are truncated in listing (selected by default). XREF X Symbol cross reference is listed at end of listing. NOXREF NOX No cross reference table is printed (selected by default). @end(Fileexample) By specifying OPT FULL, fully parenthesised arithmetic expressions evaluated in the usual algebraic order are acceptable as operands. The valid binary operators are (in increasing order of precedence): @Begin(Fileexample) ! (or), \ (exclusive or) & (and) +, - *, /, | (remainder) < (left shift), > (right shift) @end(Fileexample) The unary operators + (ignored), - and \ (complement) are accepted and take precedence over all binary operators. A '>' expression prefix is provided which forces extended addressing. This is the converse of the '<' prefix which forces direct addressing. The program counter relative address mode may be specified by offset,pc as well as label,pcr. The former does not automatically generate a relative offset from an absolute address but takes the value of the offset expression as the offset from the updated program counter. For Example, the following program segments are equivalent: @Begin(Fileexample) lab nop jmp lab,pcr lab nop jmp lab-nxtins,pc nxtins equ * @end(Fileexample) Apart from catastrophic failures, error messages are generated in the final pass only and always immediately follow the line to which they apply. This is a multi-pass assembler in which there are no constraints on the order of definition of symbols and which attempts to optimise the use of direct addressing and short branches. As a result the mnemonics for long and short branches are considered synonymous except for BRN and LBRN. @end(enumerate) @Subsection(Implementations) VAX and APM M6809 file-spec @Begin(Fileexample, LeftMargin +0) Command Qualifiers Default /[NO]LIST[=file-spec] /NOLIST /[NO]OBJECT[=file-spec] /OBJECT @end(Fileexample) Command Parameters file-spec Specifies a single M6809 assembler source program to be assembled. If a file type is not specified the assembler uses the default file type ASM. Command Qualifiers @Begin(Fileexample, LeftMargin +0) /LIST=[file-spec] /NOLIST @end(Fileexample) Controls whether a listing is produced. If file-spec is not specified the listing file has the same name as the source file and has the file type LIS. @Begin(Fileexample, LeftMargin +0) /OBJECT=[file-spec] /NOOBJECT @end(Fileexample) Controls whether an object code file is produced. If file-spec is not specified the object file has the same name as the source file and has the file type OBJ. The object code produced is in Motorola M6800 loader format. @Begin(Comment) @Section[Programming (Blowing) EPROMS for the CS2 Microkit Exercises] First prepare your program in M6809 assembly language, editing it into a file of type ASM (e.g. TEST.ASM). Because within the microkit the EPROM occupies that part of the address space between $F800 and $FFFF, you should ensure, by appropriate use of the ORG directive, that all generated code and data lie within those limits. Next you should assemble the program using the command M6809, as per the instructions given above. You are now ready to send your object file to one of the programming devices which are located in the North-West corner partition of the CS North Machine Hall (JCMB room 1206, affectionately known variously as the "darkroom" or the "Fred-laboratory"). The two devices (Microware models 32 and 33) are slightly different, but have the major instruction steps in common: @Begin(Fileexample) Configure device Select and insert EPROM Prepare device to receive Send file (from VAX or APM) Instruct device to program EPROM Remove EPROM @end(Fileexample) @SubSection(Instructions in detail) @Paragraph(Configure device) You should make sure the device is configured to program the right sort of EPROM, this should be a "2716" or "2516". The model 33 has large (24 pin) red or blue configuration plugs which fit into the black socket just above the green one. The model 32 has small (16 pin) red or blue plugs. Both models also have small (14 pin) configuration plugs which fit into a socket near the upper left hand side of the device. These latter ones are irrelevant for programming operations and the corner sockets are usually left empty. Take care, in the case of the model 32, not to confuse the 14 pin and 16 pin configuration plugs. The ones to use are marked with two horizontal white stripes just above and below the EPROM type number. @Paragraph(Select and insert EPROM) You have to insert a fresh EPROM into the green Zero Insertion Force (ZIF) socket on the device. Make sure the EPROM you plug in is of the correct type "2716" or "2516". The lever on the upper right-hand side of the socket should be in the raised position before you insert the EPROM into the socket. The small semi-circular notch on the EPROM should be on the left-hand side, facing away from the lever. After insertion, the lever should be moved through 90 degrees to a position parallel to the large surface of the socket. @Paragraph(Prepare to receive) You have to prepare the device to receive the object file. On the model 32, press the red 'F' (function) button followed by the grey 'A' button ('A' stands for serial input, see the table printed on the device). On the model 33, the procedure is a bit more complicated. Press the red 'RSET' button followed by the red 'SEL' button (the display will show "SELECT?"). Then press the grey button marked 'LD' (above 'A') (the display will show "RS232?", asking you for the terminal line baud rate etc code). Then press the four buttons '0', '1', 'E', 'ENTER' (the display will show "INPUT?", indicating that it is ready for the file to be sent). @Paragraph(Send file from VAX or APM) Use the command SEND32 or SEND33 (depending on which of the programming devices you are using), with the name of the object file as parameter (the file type OBJ is assumed and should not be mentioned explicitly). @Begin(Fileexample) Example: $ SEND33 TEST @end(Fileexample) The object file is sent to the device through the Visual 200 terminal you are using, but the information does not appear on the screen. When you have come back to command level, the file will be in the device's memory. The display of the model 22 will show two hex digits, being the contents of the first location ($F800) in the EPROM. The display of the model 33 will jitter during the transfer, but at the end will revert to "INPUT?". If the display should start flashing during the transfer, this indicates a transmission error and you should try again (go back to C). @Paragraph(Instruct device to program EPROM) Now you must tell the device to program the contents of its memory into the EPROM you have plugged in. On the model 32 proceed as follows: Press red 'F' followed by '9' ('9' stands for 'fast program', which is not mentioned on the printed table, but '8', which stands for 'program', is). The display will show a quickly counting pattern, for about 10 to 20 seconds, and then stop. If it flashes, something went wrong, you can try again from (E), or else try a different EPROM (steps F, B, E). When trying a different EPROM it is not necessary to repeat steps (C, D), since the object file contents are already in the device's memory. Function '9' is a non-standard locally-implemented extension. Function '8' is the officially recommended method, but takes about 130 seconds. We have found that for our purposes 15 seconds are usually enough to program the EPROM reliably. On the model 33 proceed as follows: Press 'RSET' then 'SEL' then 'PRG' (above '8'). The display will show "PWR ON" and a red lamp between the configuration plug and the ZIF socket will light. The programming operation will take about 200 seconds, after which the display will revert to showing a few hex digits. If it flashes, something went wrong, try again (E) or (F, B, E). For the model 33 there is no 'fast program' function, so, unless you want to wait more than 3 minutes, you should interrupt the programming operation after 15 to 20 seconds, and ask the device to verify that its memory contents agree with the EPROM contents. Here's how: Press 'RSET' then 'SEL' then 'VER' (above '3'). If the display flashes, something is wrong, you probably interrupted it too soon, go back to (E) for another ten seconds. If it still fails, try another EPROM (F, B, E). @Paragraph(Remove EPROM) Finally, remove the EPROM from the ZIF socket. Tilt the lever back to the upright position and lift the EPROM out vertically. After having used the EPROM in the microkit, return it to the tray near the erasing lamp. @SubSection(Instruction summaries) @Begin(Fileexample) @b[Model 32 Model 33] Red F Red RSET Grey A Red SEL "SEND32" Grey LD/A Red F Grey 0 Grey 9 Grey 1 Wait 20 secs Grey E Display should have stopped counting Blue ENTER "SEND33" Red RSET Red SEL Grey PRG/8 Wait 20 secs Red RSET Red SEL Grey VER/3 Should not flash @end(Fileexample) @end(comment)