home *** CD-ROM | disk | FTP | other *** search
- Introduction
- Executing MAC
- XMAC
- Assembly Control Parameters
- Assembler Pseudo-Ops
- Inline Error Messages
- Console Error Messages
- :Introduction
- MAC is the CP/M Standard Macro Assembler; it is upward-compatable with
- ASM, the CP/M Standard Assembler. The facilities of MAC include assembly
- of Intel 8080 microcomputer mnemonics, along with assembly-time
- expressions, conditional assembly, page formatting features, and a macro
- processor which is compatable with the standard Intel definition (MAC
- implements the mid-1977 revision of Intel's definition).
- MAC requires approximately 12K of machine code and table space, along
- with an additional 2.5K of I/O buffer space.
- :Executing MAC
- MAC is invoked by the following command --
- MAC d:filename $parms
- Only 'filename' is required, and it represents a file named 'filename.ASM'.
- MAC may then generate up to 3 other files -- filename.HEX (the Intel Hex
- Format File), filename.PRN (the Print or Listing file), and filename.SYM
- (a file containing a sorted list of the symbols used in the program).
- MACRO Library files may be referenced by the program; these files are
- named 'filename.LIB'.
- $parms represents the optional assembly control parameters which are
- discussed in the next section.
- MAC may be executed by employing the SUBMIT file MAC.SUB. MAC.SUB
- assembles the specified MAC .ASM file, converts it into a .COM file via
- LOAD, and erases the .HEX file. MAC.SUB is invoked by --
- SUBMIT MAC filename
- where 'filename' is the name of the MAC file 'filename.ASM'.
- :XMAC
- XMAC is a version of MAC which does NOT recognize the intrinsic Intel
- 8080 assembler language mnemonics. XMAC is intended to be used for Cross-
- Assembly using .LIB files which contain the assembler mnemonics for the
- target machine. XMAC is invoked in exactly the same way MAC is (except
- that no SUBMIT file is available), and it recognizes the same pseudo-ops
- and control parameters.
- The patch file XMAC.ASM contains the patches used to convert MAC into
- XMAC.
- The library files MAC40.LIB and XMAC40.LIB contain the macros
- necessary to assemble code for the Intel 4040 microprocessor, for example.
- MAC40.LIB renames the 4040 mnemonics for ADD, SUB, etc., to ADD4, SUB4,
- etc., so that it will not conflict with MAC. XMAC40.LIB does not rename
- these, since XMAC does not recognize these in the first place.
- :Assembly Control Parameters
- The control parameter list is preceded by a $, and may contain any of
- the following in any order --
- A - controls the source disk for the .ASM file
- H - controls the destination of the .HEX machine code file
- L - controls the source disk for the .LIB files
- M - controls MACRO listing in the .PRN file
- P - controls the destination of the .PRN listing file
- Q - controls the listing of LOCAL symbols
- S - controls the generation and destination of the .SYM file
- 1 - controls pass 1 listing
-
- In the case of the A, H, L, P, and S parameters, they may be followed
- by the drive name from which to obtain or to which to send data, where --
-
- A,B,C,D -- designates that particular drive
- P -- designates the LST: device
- X -- designates the user console (CON:)
- Z -- designates a null file (no output)
-
- For example,
- $PB AA HB SX
- sends the .PRN file to drive B:, gets the .ASM file from drive A:, sends
- the .HEX file to drive B:, and sends the .SYM file to CON:.
-
- The parameters L, S, M, Q, and 1 may be preceded by either + or - to
- enable or disable their respective functions --
-
- +L - list the input lines read from the MACRO library
- -L - suppress listing of the MACRO library (default)
-
- +S - append the .SYM output to the end of the .PRN file (default)
- -S - suppress the generation of the sorted symbol table
-
- +M - list all MACRO lines as they are processed (default)
- -M - suppress all MACRO lines as they are processed
- *M - list only HEX code generated by macro expansions in listing
-
- +Q - list all LOCAL symbols in the symbol list
- -Q - suppress all LOCAL symbols in the symbol list (default)
-
- +1 - produce a listing file on the first pass (for MACRO debugging)
- -1 - suppress listing on pass 1 (default)
-
- The programmer can intersperse controls throughout the assembly
- language source or library files. Interspersed controls are denoted by a
- "$" in the first column of the input line followed immediately by a
- parameter.
- :Assembler Pseudo-Ops
- The following Pseudo-Ops are supported --
- DB defines data bytes or strings of data
- DS reserves storage areas
- DW defines words of storage
- ELSE alternate to IF
- END terminates the physical program
- ENDIF marks the end of conditional assembly
- ENDM marks the end of a MACRO
- EQU performs a numeric "equate"
- EXITM abort expansion of the current MACRO level
- IF begins conditional assembly
- IRP INLINE MACRO with string substitution
- IRPC INLINE MACRO with character substitution
- LOCAL define LOCAL variables unique to each MACRO repetition
- MACLIB specify MACRO Library to load
- MACRO defines beginning of a MACRO
- ORG sets the program or data origin
- PAGE defines the listing page size for output
- REPT defines the beginning of a INLINE MACRO
- SET performs a numeric "set" or assignment
- TITLE enables page titles and options
- :Inline Error Messages
- B - Balance error: MACRO doesn't terminate properly or conditional
- assembly is ill-formed
- C - Comma error: expression was encountered but not delimited
- properly from the next item by a comma
- D - Date error: element in a data statement (DB,DW) cannot be placed
- in the specified data area
- E - Expression error: expression is ill-formed and cannot be computed
- I - Invalid character: a non-graphic character has been found
- L - Label error: label cannot appear in this context
- M - MACRO overflow error: internal MACRO expansion table overflow
- N - Not implemented error: unimplemented feature used
- O - Overflow error: expression is too complicated or the number of
- LOCAL labels has exceeded 9999
- P - Phase error: labels does not have same value on both passes
- (multiple label)
- R - Register error: value specified for a register is not compatable
- with op code
- S - Statement/Syntax error: statement is ill-formed
- V - Value error: operand is improperly formed or out of range
- :Console Error Messages
- NO SOURCE FILE PRESENT - .ASM file not found
- NO DIRECTORY SPACE - Directory is full
- SOURCE FILE NAME ERROR - The form of the source file name is invalid;
- note that MAC is invoked by 'MAC filename', and the .ASM file type is NOT
- specified.
- SOURCE FILE READ ERROR - Error in reading source file
- OUTPUT FILE WRITE ERROR - Error in writing output file
- CANNOT CLOSE FILE - An output file cannot be closed.
- UNBALANCED MACRO LIBRARY - No ENDM encountered for a MACRO definition
- INVALID PARAMETER - Invalid assembly parameter was found in the input
- line.