MACN11 is a PDP-11 MACRO language assembler which operates on the PDP-10. This document describes version 4 of MACN11; with the exception of differences listed in the following pages, it is compatible with the language accepted by MACRO-11 under DOS Version 9, as described in DEC's DOS/BATCH assembler manual (order no. DEC-11-LASMA-A-D). Bug reports, comments, and suggestions concerning either version of MACN11 are welcome via net mail to Koda@ISIB. Notes on MACN11 Version 4 2 MACRO-11 Language Discrepancies Features not yet supported -------------------------- .DSABL REG -- Parsed properly but ignored; Register definitions are always enabled at present. Sundry differences ------------------ .MCALL will automactically insert the file SYSMAC.SML thus defining all the system macros. This alleviates the need to place SYSMAC.SML in the command line. Default modes for the .LIST/.NLIST and .ENABL/.DSABL directives can be changed by assembly parameters in MACN11. In the configuration maintained by ISI these defaults match MACRO-11's except for the following: .NLIST TTM ; [format listings for lpt output] .ENABL LC ; [don't fold lower case] The following special characters are legal in MACN11 source code: escape, ^N, ^O, `, {, }, |, ~ Notes on MACN11 Version 4 3 Language Extensions Language extensions ------------------- .ASCII & .ASCIZ MACN11 allows multiple expressions, rather than just one, within brackets. Expressions are delimited by commas. E.g., "" can be written as "". .ENABL & .DSABL These verbs recognize three nonstandard operands: NSF (Nonstandard features): Enabled by default. Enabling NSF allows use of MACN11's extended features. Disabling limits the acceptable source language to being strictly compatible with MACRO-11. ISD (Internal Symbol Definitions): Disabled by default Enabling ISD includes definitions of internal symbols, as well as global symbols, in the object module output. These definitions allow generation of a symbol table for debuggers such as DDT-11. HOV (Hexadecimal override): Disabled by default. If the current radix is 16 and HOV is enabled, terms of expressions which begin with A-F are parsed as hex numbers, rather than symbols. E.g., .ENABL HOV ; Enabling hex override causes MOV #A,R0 ; this instruction to load 10. into ; R0, rather than the address of a ; word labelled A. .ENDM Interior macro definitions within a nest can be terminated by a .ENDM whose operand is the name of an exterior definition. Hexadecimal numbers Hex numbers, using the digits 0-9 and A-F, may be used via extensions of the existing radix control functions. .RADIX accepts 16 as a valid operand to set the current default radix, and temporary radix control includes "^H" in addition to the standard "^D", "^O", and "^B". Using hex as the default radix may require preceding some hex numbers with a 0 digit. For example, "0BAD" is clearly a hex number, but "BAD" is normally assumed to be a symbol. This assumption can be changed by ".ENABL HOV". Notes on MACN11 Version 4 4 Language Extensions .IF variants ABS -- ".IF ABS " causes assembly of the conditional block which it heads if the address expression given is absolute, rather than relocatable. Absolute expressions are those which can be evaluated entirely by the assembler; they must contain no global references and no references to labels within relocatable program sections (control sections) other than those of the form "a-b", where a and b are in the same section. EQV -- ".IF EQV ," assembles the conditional block which it heads if both expressions are equivalent. They are defined as equivalent when they have the same type, addressing mode, and value. For example, ZERO is equivalent to 0 if the former is defined by "ZERO = 0", but neither is equivalent to R0, %0, or GZERO, where GZERO is a global symbol whose value may be 0. NQV -- Identical to .EQV except that it assembles the subsequent conditional block if the two expressions are not equivalent. **** Warning: Address expressions in these .IF variants should not refer to symbols which are defined at a later point in the source input. An attempt to do this normally causes phase errors (P flags) on every symbol definition following the .IF. .LIST & .NLIST Two additional listing control operands are recognized: ASC (ASCII binary expansion): Default is .NLIST ASC. Specifying ".NLIST ASC" suppresses listing of the binary code generated by .ASCII and .ASCIZ directives. This is effectively a selective ".NLIST BIN" for the sake of listing readability where the normal alternative of ".NLIST BEX" may be undesirable. SON (Source Oriented Numbering): Default is .NLIST SON .LIST SON in the source, or /LI:SON in the command dialog, specifies source-oriented numbering of listing pages. In this format page numers appear as "n-m", where n is incremented only when a form feed is read from the source input; m is a page number extension which identifies output pages following the most recent form feed. The default for this option is .NLIST SON, for sequential numbering of output pages regardless of input file format. Notes on MACN11 Version 4 5 Language Extensions .INSERT ".INSERT filename" logically inserts the named file into the source by reading it immediately. This is convenient for specifying macro libraries required for an assembly, eliminating the need for users to type these file names in their command dialog. Logical shift operator ("_") An additional binary operator is recognized in expression evaluation. "a_b" is evaluated as "the value of a shifted left b bits". If b is negative, the term is shifted right. Both a and b may be any valid term, including a bracketed expression. A common use for this operator is in defining symbolic values for bit masks. For example, "INTENA = 1_6" defines an interrupt enable mask as a 1 in bit 6. .NKIND .NKIND is analagous to .NTYPE, but instead of returning an addressing mode it returns flag bits to indicate the type of the argument. ".NKIND symbol," sets symbol to the expression's type bits, which are defined as follows: 1 (bit 0): 1 if relocatable, 0 if absolute 2 (bit 1): 1 if global 4 (bit 2): 1 if expression defines a register 8 (bit 3): 1 if the expression is a label on a line of source code 16 (bit 4): 1 if defined, 0 if undefined .PDP10 The ".PDP10" directive is recognized, but is ignored. This is for the sake of assembling Bliss-11 compiler output. Predefined symbols Symbols can be predefined by assembling their symbol table entries into MACN11. At present register names (R0-R7, SP, and PC) and ".MACN." are defined in this way. .MACN. is equated to the assembler's version number. .VRSN. is set to the Tenex version number of the source file currently being read; if the source is not on disk .VRSN. is undefined. Notes on MACN11 Version 4 6 Language Extensions Radix 50 terms in expressions: ^R "^R" is recognized as a unary operator in expressions, indicating that the next three characters are to be converted to radix 50 format for use as a 16-bit value. Any character without a radix 50 equivalent is treated as a delimiter, and is taken as equivalent to trailing blanks in evaluating the term. .REQUIRE ".REQUIRE filename" performs exactly the same function as ".INSERT filename", except that it also forces a page skip in the assembly listing before the file is read. .SBHED A new directive, .SBHED, specifies a subheading; it functions as a conditional .PAGE followed by a .SBTTL. It skips to a new page unless the most recent listing output was a page skip, then outputs a standard page heading. .SBHED's operand field is included in the table of contents and in all page subheadings until another .SBHED or a .SBTTL is issued. The .SBHED directive itself is the first line listed below the new page heading. Notes on MACN11 Version 4 7 Operating Procedures Operating procedures -------------------- Operating procedures for MACN11 are nearly identical to MACRO-11's. The only differences are the following: 1. "=" and "_" are accepted as synonyms for "<". 2. The /PA switch is accepted but is ignored. 3. An additional switch, /FO, is available to specify the PDP-10 file format for object output. 4. Cross reference tables are generated by MACN11 by default. Using the /CRF switch will create a file that can be processed by CREF. 5. Another added switch, "/EQ", sets specified assembly parameters to zero. For example, "/EQ:A:B" is equivalent to supplying "A=0" and "B=0" in the source. 6. The command dialog accepts full Tenex file names, including directory names and file version numbers, and performs file name recognition as usual with escape and control-F. Details of these differences are included in the description below. MACN11 assembles one or more source files, normally producing two files: a relocatable object module and an assembly listing. Command string syntax is similar to MACRO-11's. Object files normally are generated in packed format, with each PDP-11 word right-adjusted in a PDP-10 halfword. This format is standard for other utilities which may deal with these files (LNKX11, LINK11, FILEX, etc.). Notes on MACN11 Version 4 8 Operating Procedures Command Input String -------------------- When MACN11 is ready for a command it lists its name and version number on the user's terminal, then outputs a "*" on a new line. In return it expects the following sort of string: object,listingfilename.extension;version" -- with the usual defaulting conventions for directory and version. If the extension is omitted MACN11 chooses a default appropriate to the type of file (object, listing, or source). "Object" is normally a relocatable object module file, ready for input to LNKX11 or LINK-11. Its default extension is ".OBJ". Absolute binary output, with default extension ".BIN", can be generated by using ".ENABL ABS" in the source program, or by including a "/EN:ABS" switch in the command string. Object file format may be specified with the "/FO" switch. Switch values set three independent paramters, with an effective default of "/FO:P:NAL:NOP". The following values are legal: Basic format selection: P Packed format -- one PDP-11 word right-adjusted in each PDP-10 half word I Image format -- one PDP-11 byte right-adjusted in each PDP-10 word Alignment of the start of output blocks in PDP-10 words for packed format output: NAL No alignment HAL Half word alignment WAL Word alignment Padding between blocks: NOP No padding PAD Standard padding -- 8 bytes for .OBJ files, 6 bytes for .BIN files Notes on MACN11 Version 4 9 Operating Procedures "Listing" is an ASCII file with a default extension of ".LST". Cross references may be obtained by using a "/CRF" switch with the listing file; this generates a file with extension ".CRF", which must subsequently be processed by CREF. Source files are in ASCII, with the following default extensions recognized by the assembler: ".M11", ".P11", ".MAC", ".SML", and blank Either the object file or the listing file, but not both, may be omitted. Any number of source files (except 0) may be used. While an assembly is running it's progress may be monitored by typing control-Q. MACN11 responds to this identifying the assembler pass (1 or 2), the source file being processed, and the current input line number.