home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / lambda / soundpot / a / cpmhlp.lbr / MAC.HZP / MAC.HLP
Encoding:
Text File  |  1993-10-26  |  7.5 KB  |  150 lines

  1. Introduction
  2. Executing MAC
  3. XMAC
  4. Assembly Control Parameters
  5. Assembler Pseudo-Ops
  6. Inline Error Messages
  7. Console Error Messages
  8. :Introduction
  9.      MAC is the CP/M Standard Macro Assembler; it is upward-compatable with
  10. ASM,  the CP/M Standard Assembler.   The facilities of MAC include assembly
  11. of   Intel   8080  microcomputer  mnemonics,   along   with   assembly-time
  12. expressions,  conditional assembly,  page formatting features,  and a macro
  13. processor  which  is  compatable with the standard  Intel  definition  (MAC
  14. implements the mid-1977 revision of Intel's definition).
  15.      MAC requires approximately 12K of machine code and table space,  along
  16. with an additional 2.5K of I/O buffer space.
  17. :Executing MAC
  18.      MAC is invoked by the following command --
  19.                          MAC d:filename $parms
  20. Only 'filename' is required, and it represents a file named 'filename.ASM'.
  21. MAC  may  then generate up to 3 other files -- filename.HEX (the Intel  Hex
  22. Format File),  filename.PRN (the Print or Listing file),  and  filename.SYM
  23. (a file containing a sorted list of the symbols used in the program).
  24.      MACRO Library files may be referenced by the program;  these files are
  25. named 'filename.LIB'.
  26.      $parms  represents the optional assembly control parameters which  are
  27. discussed in the next section.
  28.      MAC  may be executed by employing the SUBMIT  file  MAC.SUB.   MAC.SUB
  29. assembles  the  specified MAC .ASM file,  converts it into a .COM file  via
  30. LOAD, and erases the .HEX file.  MAC.SUB is invoked by --
  31.           SUBMIT MAC filename
  32. where 'filename' is the name of the MAC file 'filename.ASM'.
  33. :XMAC
  34.      XMAC  is a version of MAC which does NOT recognize the intrinsic Intel
  35. 8080 assembler language mnemonics.   XMAC is intended to be used for Cross-
  36. Assembly  using  .LIB files which contain the assembler mnemonics  for  the
  37. target  machine.   XMAC is invoked in exactly the same way MAC  is  (except
  38. that  no SUBMIT file is available),  and it recognizes the same  pseudo-ops
  39. and control parameters.
  40.      The patch file XMAC.ASM contains the patches used to convert MAC  into
  41. XMAC.
  42.      The   library  files  MAC40.LIB  and  XMAC40.LIB  contain  the  macros
  43. necessary to assemble code for the Intel 4040 microprocessor,  for example.
  44. MAC40.LIB renames the 4040 mnemonics for ADD,  SUB,  etc.,  to ADD4,  SUB4,
  45. etc.,  so that it will not conflict with MAC.   XMAC40.LIB does not  rename
  46. these, since XMAC does not recognize these in the first place.
  47. :Assembly Control Parameters
  48.      The control parameter list is preceded by a $,  and may contain any of
  49. the following in any order --
  50.           A - controls the source disk for the .ASM file
  51.           H - controls the destination of the .HEX machine code file
  52.           L - controls the source disk for the .LIB files
  53.           M - controls MACRO listing in the .PRN file
  54.           P - controls the destination of the .PRN listing file
  55.           Q - controls the listing of LOCAL symbols
  56.           S - controls the generation and destination of the .SYM file
  57.           1 - controls pass 1 listing
  58.  
  59.      In the case of the A,  H, L, P, and S parameters, they may be followed
  60. by the drive name from which to obtain or to which to send data, where --
  61.  
  62.           A,B,C,D -- designates that particular drive
  63.           P       -- designates the LST: device
  64.           X       -- designates the user console (CON:)
  65.           Z       -- designates a null file (no output)
  66.  
  67. For example,
  68.           $PB AA HB SX
  69. sends  the .PRN file to drive B:,  gets the .ASM file from drive A:,  sends
  70. the .HEX file to drive B:, and sends the .SYM file to CON:.
  71.  
  72.      The parameters L,  S,  M, Q, and 1 may be preceded by either + or - to
  73. enable or disable their respective functions --
  74.  
  75.      +L - list the input lines read from the MACRO library
  76.      -L - suppress listing of the MACRO library (default)
  77.  
  78.      +S - append the .SYM output to the end of the .PRN file (default)
  79.      -S - suppress the generation of the sorted symbol table
  80.  
  81.      +M - list all MACRO lines as they are processed (default)
  82.      -M - suppress all MACRO lines as they are processed
  83.      *M - list only HEX code generated by macro expansions in listing
  84.  
  85.      +Q - list all LOCAL symbols in the symbol list
  86.      -Q - suppress all LOCAL symbols in the symbol list (default)
  87.  
  88.      +1 - produce a listing file on the first pass (for MACRO debugging)
  89.      -1 - suppress listing on pass 1 (default)
  90.  
  91.      The  programmer  can  intersperse  controls  throughout  the  assembly
  92. language source or library files.   Interspersed controls are denoted by  a
  93. "$"  in  the  first  column of the input line  followed  immediately  by  a
  94. parameter.
  95. :Assembler Pseudo-Ops
  96.      The following Pseudo-Ops are supported --
  97.           DB        defines data bytes or strings of data
  98.           DS        reserves storage areas
  99.           DW        defines words of storage
  100.           ELSE      alternate to IF
  101.           END       terminates the physical program
  102.           ENDIF     marks the end of conditional assembly
  103.           ENDM      marks the end of a MACRO
  104.           EQU       performs a numeric "equate"
  105.           EXITM     abort expansion of the current MACRO level
  106.           IF        begins conditional assembly
  107.           IRP       INLINE MACRO with string substitution
  108.           IRPC      INLINE MACRO with character substitution
  109.           LOCAL     define LOCAL variables unique to each MACRO repetition
  110.           MACLIB    specify MACRO Library to load
  111.           MACRO     defines beginning of a MACRO
  112.           ORG       sets the program or data origin
  113.           PAGE      defines the listing page size for output
  114.           REPT      defines the beginning of a INLINE MACRO
  115.           SET       performs a numeric "set" or assignment
  116.           TITLE     enables page titles and options
  117. :Inline Error Messages
  118.      B  - Balance  error:  MACRO doesn't terminate properly or  conditional
  119. assembly is ill-formed
  120.      C  - Comma  error:   expression  was  encountered  but  not  delimited
  121. properly from the next item by a comma
  122.      D - Date error:  element in a data statement (DB,DW) cannot be  placed
  123. in the specified data area
  124.      E - Expression error:  expression is ill-formed and cannot be computed
  125.      I - Invalid character:  a non-graphic character has been found
  126.      L - Label error:  label cannot appear in this context
  127.      M - MACRO overflow error:  internal MACRO expansion table overflow
  128.      N - Not implemented error:  unimplemented feature used
  129.      O  - Overflow  error:  expression is too complicated or the number  of
  130. LOCAL labels has exceeded 9999
  131.      P  - Phase  error:   labels does not have same value  on  both  passes
  132. (multiple label)
  133.      R - Register error:  value specified for a register is not  compatable
  134. with op code
  135.      S - Statement/Syntax error:  statement is ill-formed
  136.      V - Value error:  operand is improperly formed or out of range
  137. :Console Error Messages
  138.      NO SOURCE FILE PRESENT - .ASM file not found
  139.      NO DIRECTORY SPACE - Directory is full
  140.      SOURCE  FILE NAME ERROR - The form of the source file name is invalid;
  141. note that MAC is invoked by 'MAC filename',  and the .ASM file type is  NOT
  142. specified.
  143.      SOURCE FILE READ ERROR - Error in reading source file
  144.      OUTPUT FILE WRITE ERROR - Error in writing output file
  145.      CANNOT CLOSE FILE - An output file cannot be closed.
  146.      UNBALANCED MACRO LIBRARY - No ENDM encountered for a MACRO definition
  147.      INVALID  PARAMETER - Invalid assembly parameter was found in the input
  148. line.
  149.  
  150.