home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_300 / 348_01 / z80a.man < prev    next >
Text File  |  1991-05-02  |  52KB  |  1,723 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.                             Z80 Cross Assembler
  14.  
  15.  
  16.                              Portable Version
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.        This program lets you use your computer to assemble code for
  38.        the Intel Z80 family of microprocessors.  The program is
  39.        written in portable C.  All assembler features are supported
  40.        except relocation, linkage, and macros.
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.                       Z80 Cross-Assembler (Portable)
  75.                                Version 0.0
  76.                    Copyright (c) 1988 Michael G. Panas
  77.  
  78.  
  79.  
  80.  
  81.        1.  Introduction
  82.  
  83.        This assembler  was  developed  to  cross-assemble  the  Z80
  84.        assembly language mnemonics and pseudo opcodes defined by an
  85.        assembler already running on a mini-computer.  As  such  the
  86.        mnemonics may look very strange, since they are not standard
  87.        Zilog Z80 mnemonics but, extensions to  the  8080  language.
  88.        Many enhancements to the original mini-computer version have
  89.        been made.
  90.  
  91.        This package  assembles  the  dialect  of  Z80  source  code
  92.        defined  in  Appendix  I  into Z80 object code.  It will run
  93.        under DOS 2.x and up and also  several  UNIX  machines  (see
  94.        appendix II - portability).
  95.  
  96.  
  97.        2.  How to Use the Cross-Assembler
  98.  
  99.        This program requires one input file (your Z80 source  code)
  100.        and  zero  to two output files (the listing and the object).
  101.        The input file MUST be specified, or the assembler will bomb
  102.        on  a  fatal  error.   The  listing  and  object  files  are
  103.        optional.  If no listing file is specified,  no  listing  is
  104.        generated,  and if no object file is specified, no object is
  105.        generated.  If the object file is specified, the  object  is
  106.        written to this file in "Intel hexadecimal" format.
  107.  
  108.        The command line for the cross-assembler looks like this:
  109.  
  110.        z80a source_file { -l list_file } { -o object_file }
  111.  
  112.        where the { } indicates that the specified item is optional.
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.                                   Page 1
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.             Some examples are in order:
  141.  
  142.             z80a testz80.asm                 source:        testz80.asm
  143.                                             listing:        none
  144.                                              object:        none
  145.  
  146.             z80a testz80.asm -l testz80.prn  source:        testz80.asm
  147.                                             listing:        testz80.prn
  148.                                              object:        none
  149.  
  150.             z80a testz80.asm -o testz80.hex  source:        testz80.asm
  151.                                              listing:       none
  152.                                              object:        testz80.hex
  153.  
  154.             z80a testz80.asm -l testz80.prn -o testz80.hex
  155.                                              source:        testz80.asm
  156.                                             listing:        testz80.prn
  157.                                              object:        testz80.hex
  158.  
  159.        The order in which the source, listing, and object files are
  160.        specified  does  not matter.  Note that no default file name
  161.        extensions are supplied by the assembler as this gives  rise
  162.        to portability problems.
  163.  
  164.  
  165.        3.  Format of Cross-Assembler Source Lines
  166.  
  167.        The source file that the cross-assembler  processes  into  a
  168.        listing  and  an  object  is an ASCII text file that you can
  169.        prepare with whatever editor you have at  hand.   The  most-
  170.        significant (parity) bit of each character is cleared as the
  171.        character is read  from  disk  by  the  cross-assembler,  so
  172.        editors that set this bit (such as WordStar's document mode)
  173.        should not bother this program.   All  printing  characters,
  174.        the  ASCII TAB character (09H), and newline character(s) are
  175.        processed by the assembler.  All other characters are passed
  176.        through to the listing file, but are otherwise ignored.
  177.  
  178.        The  source  file  is  divided   into   lines   by   newline
  179.        character(s).   The  internal buffers of the cross-assembler
  180.        will accommodate lines of up to 255 characters which  should
  181.        be  more  than  ample  for  almost any job.  If you must use
  182.        longer lines, change the constant MAXLINE in file z80a.h and
  183.        recompile the cross-assembler.  Otherwise, you will overflow
  184.        the buffers, and the program will mysteriously crash.
  185.  
  186.        Each source line is made up  of  three  fields:   the  label
  187.        field,  the opcode field, and the argument field.  The label
  188.        field is optional, but if it is present, it  must  begin  in
  189.        column  1.  The  opcode  field  is  optional,  but  if it is
  190.        present, it must not begin in column 1.  If both a label and
  191.  
  192.  
  193.  
  194.                                   Page 2
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.        an  opcode  are  present,  one  or  more  spaces  and/or TAB
  207.        characters must separate the two.  If  the  opcode  requires
  208.        arguments,  they  are  placed in the argument field which is
  209.        separated from the opcode field by one or more spaces and/or
  210.        TAB   characters.    Multiple  arguments  are  separated  by
  211.        semicolons.  Finally, an optional comment can  be  added  to
  212.        the  end  of  the  line.   This  comment  can  begin with an
  213.        optional asterisk which signals the assembler  to  pass  the
  214.        rest  of  the  line  to the listing and otherwise ignore it.
  215.        The assembler ignores any text after the argument field, for
  216.        this  reason  arguments  must not contain any spaces.  Thus,
  217.        the source line looks like this:
  218.  
  219.             {label}{ opcode{ arguments}}{{*}commentary}
  220.  
  221.        where the { } indicates that the specified item is optional.
  222.  
  223.             Some examples are in order:
  224.  
  225.             column 1
  226.             |
  227.             v
  228.             GRONK           JP      NC; LOOP        This line has everything.
  229.                             INC     C               This line has no label.
  230.                             BEEP                    This line has no opcode.
  231.             *                                       This line has no label and no opcode.
  232.  
  233.             * The previous line has nothing at all.
  234.                             END                     This line has no argument.
  235.  
  236.        3.1  Labels
  237.  
  238.        A label is any sequence of alphabetic or numeric  characters
  239.        starting with an alphabetic.  The legal alphabetics are:
  240.  
  241.             ! $ % & , . : ? [  ] ^ _  ` { | }  ~  A-Z  a-z
  242.  
  243.        The numeric characters are the digits 0-9.  Note that "A" is
  244.        not the same as "a" in a label.  This is an enhancement from
  245.        the mini-computer version which  accepted  only  upper  case
  246.        labels.   This  can  explain  mysterious U (undefined label)
  247.        errors occurring when a label appears to be defined.
  248.  
  249.        A label is permitted on any line except  a  line  where  the
  250.        opcode  is  LIST,  ULIST,  NCODE, CODE, TTL, PAG, PAGT, SKP,
  251.        TYP, IF, ELS, or ENF.  The label is assigned  the  value  of
  252.        the  assembly  program counter before any of the rest of the
  253.        line is processed except when the opcode  is  EQU,  ORG,  or
  254.        SET.
  255.  
  256.  
  257.  
  258.  
  259.  
  260.                                   Page 3
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.        Labels can have the same name as opcodes,  but  they  cannot
  273.        have  the same name as operators or registers.  The reserved
  274.        (operator and register) names are:
  275.  
  276.                *       A       AF      AND     B       BC
  277.                C       D       DE      EQ      GE      GT
  278.                H       HIGH    HL      IX      IY      L
  279.                LE      LT      LOW     M       MOD     NC
  280.                NE      NOT     NZ      OR      P       PE
  281.                PO      SHL     SHR     SP      XOR     Z
  282.  
  283.        Labels may be pin-addressed by the use of an "@" as a prefix
  284.        to the label.  Pin-address labels are referenced in the code
  285.        by the opposite side of the bytes than they normally  would.
  286.        For  example this DC strings' label points to the right hand
  287.        address of the string[B:
  288.  
  289.             LABEL   DC      "this is a normal string"
  290.  
  291.        If you then generate a pin-addressed  version  of  the  same
  292.        string  the  label  refers  to  the left hand address of the
  293.        string:
  294.  
  295.             @LABEL  DC      "this is a normal string"
  296.  
  297.        It is neccessary to include pin-addressing in this assembler
  298.        to remain compatable with existing source files written with
  299.        the mini-computer version.  The sense of byte addresses when
  300.        referenced  without pin-addressing is reversed from what one
  301.        would expect in many pseudo ops such as DC and DAC.
  302.  
  303.        If a label is used in an expression before it is assigned  a
  304.        value,  the  label  is said to be "forward-referenced."  For
  305.        example:
  306.  
  307.                L1      EQU     L2+1    L2 is forward-referenced here.
  308.                L2
  309.                L3      EQU     L2+1    L2 is not forward-referenced here.
  310.  
  311.        Note no space between operands or operators is allowed.
  312.  
  313.        3.2  Numeric Constants
  314.  
  315.        Numeric constants can be  formed  in  two  ways;  the  mini-
  316.        computer  version,  or  by  the Intel convention.  The Intel
  317.        convention  was  not  part  of  the  original  mini-computer
  318.        language, but has been added as an enhancement.
  319.  
  320.        The original  standard  used  only  decimal  or  hexadecimal
  321.        numbers  in  the  style  of  Motorola.   Decimal numbers are
  322.        formed by using the  digits  0-9.  Hexadecimal  numbers  are
  323.  
  324.  
  325.  
  326.                                   Page 4
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338.        formed  by  using  a dollar sign ($) followed by one or more
  339.        hexadecimal digits (0-9,  A-F).   The  hex  digits  a-f  are
  340.        converted  to upper case by the assembler.  Also added as an
  341.        enhancement was the (%) Motorola  style  prefix  for  binary
  342.        numbers. In this case only 0 and 1 are allowed as digits.
  343.  
  344.        A numeric constant formed according to the Intel  convention
  345.        starts  with  a numeric character (0-9), continues with zero
  346.        or more digits (0-9, A-F), and ends with  an  optional  base
  347.        designator.   The  base  designators  are H for hexadecimal,
  348.        none or D for decimal, O or Q for octal, and B  for  binary.
  349.        The  hex  digits  a-f  are  converted  to  upper case by the
  350.        assembler.  Note that an Intel style numeric constant cannot
  351.        begin  with  A-F  as  it  would  be indistinguishable from a
  352.        label.
  353.  
  354.        Thus, all of the following evaluate to 255 (decimal):
  355.  
  356.             $ff  %11111111   0ffH   255   255D   377O   377Q   11111111B
  357.  
  358.        3.3  String Constants
  359.  
  360.        A string constant is zero or  more  characters  enclosed  in
  361.        either  single  quotes (' ') or double quotes (" ").  Single
  362.        quotes only match single  quotes,  and  double  quotes  only
  363.        match double quotes, so if you want to put a single quote in
  364.        a string, you can do it like this:  "'".   In  all  contexts
  365.        except  the  DB statement, the first character or two of the
  366.        string constant are all that are used.  The rest is ignored.
  367.        Noting  that  the  ASCII  codes for "A" and "B" are 041H and
  368.        042H, respectively, will explain the following examples:
  369.  
  370.             "" and ''               evaluate to 0000H
  371.             "A" and 'A'     evaluate to 0041H
  372.             "AB"            evaluates to 4142H
  373.  
  374.        Note that the null string  ""  is  legal  and  evaluates  to
  375.        0000H.
  376.  
  377.        Several escape sequences are also valid in strings:
  378.  
  379.             Character       HEX Gen Function
  380.             &N              00      Null
  381.             &B              08      Backspace
  382.             &T              09      Tab
  383.             &V              0B      Vertical Tab
  384.             &I              0D      Carridge Return
  385.             &&              26      A single &
  386.             &F              FF         -
  387.             &$XX            XX      Embedded Hex data
  388.  
  389.  
  390.  
  391.  
  392.                                   Page 5
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404.        3.4  Expressions
  405.  
  406.        An expression is made up of labels, numeric  constants,  and
  407.        string  constants  glued together with arithmetic operators,
  408.        logical operators, and parentheses in  the  usual  way  that
  409.        algebraic   expressions   are   made.   Operators  have  the
  410.        following fairly natural order of precedence:
  411.  
  412.             Highest         anything in parentheses
  413.             unary +,  unary -
  414.             *,  /,  MOD,  SHL,  SHR
  415.             binary +,  binary -
  416.             LT,  LE,  EQ,  GE,  GT,  NE
  417.             NOT
  418.             AND
  419.             OR,  XOR
  420.             Lowest          HIGH,  LOW
  421.  
  422.        A few notes about the various operators are in order:
  423.  
  424.        1)      The remainder operator MOD yields the remainder from
  425.                dividing its left operand by its right operand.
  426.  
  427.        2)      The shifting operators SHL and SHR shift their  left
  428.                operand  to  the  left  or  right the number of bits
  429.                specified  by  their  right  operand.    Since   the
  430.                exponentiation  operator  (**)  is not supported the
  431.                SHL operator can be used in most  cases  to  replace
  432.                it.
  433.  
  434.        3)      The relational operators LT, LE, EQ, GE, GT, and  NE
  435.                can also be written as <, <= or =<, =, >= or =>, and
  436.                <> or ><, respectively.  They evaluate to 0FFFFH  if
  437.                the statement is true, 0 otherwise.
  438.  
  439.        4)      The logical  opeators  NOT,  AND,  OR,  and  XOR  do
  440.                bitwise operations on their operand(s).
  441.  
  442.        5)      HIGH and LOW extract the high or  low  byte,  of  an
  443.                expression.
  444.  
  445.        6)      The special symbol * can be used in place of a label
  446.                or  constant  to  represent the value of the program
  447.                counter before any of  the  current  line  has  been
  448.                processed.
  449.  
  450.             Here are some examples of legal expressions:
  451.  
  452.        All arithmetic is unsigned with  overflow  from  the  16-bit
  453.        word ignored.  Thus:
  454.  
  455.  
  456.  
  457.  
  458.                                   Page 6
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.  
  470.             2+3*4                                   evaluates to 14
  471.             (2+3)*4                         evaluates to 20
  472.             NOT 11110000B XOR 00001010B     evaluates to 00000101B
  473.             HIGH 1234H SHL 1                        evaluates to 0024H
  474.             001Q EQ 0                               evaluates to 0
  475.             001Q = 2 SHR 1                          evaluates to 0FFFFH
  476.  
  477.             32768 * 2                       evaluates to 0
  478.  
  479.  
  480.        4.  Machine Opcodes
  481.  
  482.        The opcodes of the Z80 processor that are supported by  this
  483.        assembler are listed with thier syntax and Zilog equivalents
  484.        in Appendix I.
  485.  
  486.  
  487.        5.  Pseudo Opcodes
  488.  
  489.        Unlike Z80  opcodes,  pseudo  opcodes  (pseudo-ops)  do  not
  490.        represent   machine   instructions.    They   are,   rather,
  491.        directives  to  the  assembler.   These  directives  require
  492.        various numbers and types of arguments.  They will be listed
  493.        individually below.
  494.  
  495.        5.1  Pseudo-ops -- DC and DATA
  496.  
  497.        The DC and DATA  pseudo-ops  allow  arbitrary  bytes  to  be
  498.        spliced  into  the  object code.  Its argument is a chain of
  499.        zero or more expressions that evaluate to -128  through  255
  500.        separated  by  semicolons.   If  a  semicolon occurs with no
  501.        preceding expression, a 00H byte is spliced into the  object
  502.        code.  The sequence of bytes 0FEH, 0FFH, 00H, 01H, 02H could
  503.        be spliced into the code with the following statement:
  504.  
  505.                DC      -2;-1;;1;2
  506.  
  507.        A special case exists here.  If a string constant is entered
  508.        with  no  arithmetic  done  on it, then the entire string is
  509.        spliced into the code stream.  Thus, the sequence  of  bytes
  510.        002H,  043H, 041H, 054H, 044H could be spliced into the code
  511.        with the following statement:
  512.  
  513.                DC      1+1;"CAT";"C"+1
  514.  
  515.        The label associated with a DC statement will point  to  the
  516.        right-most  byte  of  the  entire  definition.   This can be
  517.        changed to the left most byte by pin-addressing  the  label.
  518.        Thus  the  label  in  the next statement points to the fifth
  519.        byte (the null):
  520.  
  521.  
  522.  
  523.  
  524.                                   Page 7
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536.        MESS    DC      "Mess";$00
  537.  
  538.        5.2  Pseudo-ops -- DA
  539.  
  540.        The DA pseudo-op is used to reserve a block of  storage  for
  541.        program   variables,  or  whatever.   This  storage  is  not
  542.        initialized in any way,  so  its  value  at  run  time  will
  543.        usually  be  random.   The  argument  expression  (which may
  544.        contain no forward references)  is  added  to  the  assembly
  545.        program  counter.   The following statement would reserve 10
  546.        bytes of storage called "STORAGE":
  547.  
  548.                STORAGE DS      10
  549.  
  550.        The label points to the right-most byte and may  be  changed
  551.        to left by pin-addressing the label:
  552.  
  553.                @STORAGE        DS      10
  554.  
  555.        5.3  Pseudo-ops -- DAC
  556.  
  557.        The DAC pseudo-op allows 16-bit words to be spliced into the
  558.        object  code.   Its  argument  is  a  chain  of zero or more
  559.        expressions separated by semicolons.  If a semicolon  occurs
  560.        with  no  preceding  expression,  a word of 0000H is spliced
  561.        into the code.  The word is placed into memory low  byte  in
  562.        low address, high byte in high address as per standard Intel
  563.        order.  The sequence of bytes 0FEH, 0FFH, 00H, 00H, 01H, 02H
  564.        could be spliced into the code with the following statement:
  565.  
  566.                DW      0FFFEH;;0201H
  567.  
  568.        The label if present points to the right-most byte  and  may
  569.        be changed to left by pin-addressing the label.
  570.  
  571.        5.4  Pseudo-ops -- CSECT
  572.  
  573.        Used in the mini-computer version to enter a control section
  574.        into the object code. In this assembler it is a nop provided
  575.        for compatability only.
  576.  
  577.        5.5  Pseudo-ops -- NCODE
  578.  
  579.        Turns off object code generation in the output file.   NCODE
  580.        allows RAM areas to be defined without the generation of any
  581.        code.  The listing is still enabled unless turned off  by  a
  582.        SKP.
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.                                   Page 8
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601.  
  602.        5.6  Pseudo-ops -- CODE
  603.  
  604.        Enables object code generation  if  previously  disabled  by
  605.        NCODE.
  606.  
  607.        5.7  Pseudo-ops -- END
  608.  
  609.        The END  pseudo-op  tells  the  assembler  that  the  source
  610.        program  is  over.  Any further lines of the source file are
  611.        ignored and not passed on to the listing.  If an argument is
  612.        added  to  the END statement, the value of the argument will
  613.        be placed in the execution address slot  in  the  Intel  hex
  614.        object  file.  The execution address defaults to the program
  615.        counter value at the point where the  END  was  encountered.
  616.        Thus, to specify that the program starts at label START, the
  617.        END statement would be:
  618.  
  619.                END     START
  620.  
  621.        If end-of-file is encountered on the source file  before  an
  622.        END  statement  is  reached,  the  assembler will add an END
  623.        statement to the listing and  flag  it  with  a  *  (missing
  624.        statement) error.
  625.  
  626.        5.8  Pseudo-ops -- EQU
  627.  
  628.        The EQU pseudo-op is used to assign a specific  value  to  a
  629.        label,  thus  the  label on this line is REQUIRED.  Once the
  630.        value is assigned, it cannot be reassigned  by  writing  the
  631.        label  in  column  1,  by  another  EQU  statement  by a REG
  632.        statement, or by a SET statement.  Thus,  for  example,  the
  633.        following statement assigns the value 2 to the label TWO:
  634.  
  635.                TWO     EQU     1 + 1
  636.  
  637.        The expression in the argument field must contain no forward
  638.        references.
  639.  
  640.        5.9  Pseudo-ops -- IF, ELS, ENF
  641.  
  642.        These three pseudo-ops allow the assembler to choose whether
  643.        or  not  to  assemble  certain  blocks  of code based on the
  644.        result of an expression.  Code  that  is  not  assembled  is
  645.        passed  through  to the listing but otherwise ignored by the
  646.        assembler.  The IF pseudo-op  signals  the  beginning  of  a
  647.        conditionally  assembled  block.   It  requires one argument
  648.        that may contain no forward references.  If the value of the
  649.        argument  is  non-zero,  the block is assembled.  Otherwise,
  650.        the block is ignored.  The ENF pseudo-op signals the end  of
  651.        the conditionally assembled block. For example:
  652.  
  653.  
  654.  
  655.  
  656.                                   Page 9
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.  
  668.                IF      EXPRESSION      ;This whole thing generates
  669.                DB      01H, 02H, 03H   ;  no code whatsoever if
  670.                ENF                     ;  EXPRESSION is zero.
  671.  
  672.        The ELS pseudo-op allows the assembly of either one  of  two
  673.        blocks,  but  not  both.   The  following  two sequences are
  674.        equivalent:
  675.  
  676.                             IF      EXPRESSION
  677.                             ... some stuff ...
  678.                             ELS
  679.                             ... some more stuff ...
  680.                             ENF
  681.  
  682.             TEMP_LAB        SET     EXPRESSION
  683.                             IF      TEMP_LAB NE 0
  684.                             ... some stuff ...
  685.                             ENF
  686.                             IF      TEMP_LAB EQ 0
  687.                             ... some more stuff ...
  688.                             ENF
  689.  
  690.        The pseudo-ops in this group do NOT permit labels  to  exist
  691.        on the same line as the status of the label (ignored or not)
  692.        would be ambiguous.
  693.  
  694.        All IF  statements  (even  those  in  ignored  conditionally
  695.        assembled blocks) must have corresponding ENF statements and
  696.        all ELS and ENF statements  must  have  a  corresponding  IF
  697.        statement.
  698.  
  699.        IF blocks can be nested up to  16  levels  deep  before  the
  700.        assembler  dies  of  a fatal error.  This should be adequate
  701.        for any conceivable job, but if you need  more,  change  the
  702.        constant IFDEPTH in file z80a.H and recompile the assembler.
  703.  
  704.        5.10  Pseudo-ops -- USE
  705.  
  706.        The USE pseudo-op is used to splice the contents of  another
  707.        file  into  the  current file at assembly time.  The name of
  708.        the file  to  be  USEd  is  specified  as  a  normal  string
  709.        constant, so the following line would splice the contents of
  710.        file "const.def" into the source code stream:
  711.  
  712.                USE     "const.def"
  713.  
  714.        USE files may, in turn, USE other files until four files are
  715.        open  simultaneously.   This  limit should be enough for any
  716.        conceivable job, but if you need more, change  the  constant
  717.        FILES in file z80a.H and recompile the assembler.
  718.  
  719.  
  720.  
  721.  
  722.                                  Page 10
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.  
  731.  
  732.  
  733.  
  734.        5.11  Pseudo-ops -- ORG and RLC
  735.  
  736.        The ORG pseudo-op  is  used  to  set  the  assembly  program
  737.        counter  to a particular value.  The expression that defines
  738.        this value may contain no forward references.   The  default
  739.        initial value of the assembly program counter is 0000H.  The
  740.        following  statement  would  change  the  assembly   program
  741.        counter to 0F000H:
  742.  
  743.                ORG     0F000H
  744.  
  745.        If a label is present on the same line as an ORG  statement,
  746.        it  is  assigned  the  new  value  of  the  assembly program
  747.        counter.
  748.  
  749.        The RLC pseudo-op was used to relocate a block  of  code  to
  750.        run  in  a  different  address  than  it  was loaded.  It is
  751.        provided here as an ORG statement since  relocation  is  not
  752.        supported.
  753.  
  754.        5.12  Pseudo-ops -- URLC
  755.  
  756.        Nop provided for compatability.
  757.  
  758.        5.13  Pseudo-ops -- PAG
  759.  
  760.        The PAG pseudo-op always causes an immediate  page  ejection
  761.        in  the  listing  by  inserting a form feed ('\f') character
  762.        before the next line.  If  an  argument  is  specified,  the
  763.        argument  expression  specifies the number of lines per page
  764.        in the listing. Legal values  for  the  expression  are  any
  765.        number  except  1  and  2.   A  value of 0 turns the listing
  766.        pagination off.  Thus, the following statement cause a  page
  767.        ejection and would divide the listing into 60-line pages:
  768.  
  769.                PAGE    60
  770.  
  771.        Note arguments to PAG are  an  enhancement  from  the  mini-
  772.        computer version.
  773.  
  774.        5.14  Pseudo-ops -- SKP
  775.  
  776.        Causes subsequent lines to not be  printed  on  the  listing
  777.        until  a TYP statment is encountered.  SKP/TYP blocks may be
  778.        nested.
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.                                  Page 11
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799.  
  800.        5.15  Pseudo-ops -- TYP
  801.  
  802.        List output is resumed.
  803.  
  804.        5.16  Pseudo-ops -- LIST and ULIST
  805.  
  806.        Nops provided for compatability. Originally altered assembly
  807.        listing format.
  808.  
  809.        5.17  Pseudo-ops -- SET
  810.  
  811.        The SET pseudo-op functions like the  EQU  pseudo-op  except
  812.        that  the  SET  statement  can reassign the value of a label
  813.        that has already been assigned  by  another  SET  statement.
  814.        Like  the EQU statement, the argument expression may contain
  815.        no forward references.  A label defined by a  SET  statement
  816.        cannot be redefined by writing it in column 1 or with an EQU
  817.        statement. The following series of statements would set  the
  818.        value of label "COUNT" to 1, 2, then 3:
  819.  
  820.                COUNT           SET     1
  821.                COUNT           SET     2
  822.                COUNT           SET     3
  823.  
  824.        5.18  Pseudo-ops -- TTL
  825.  
  826.        The TTL pseudo-op sets the running title  for  the  listing.
  827.        The  argument  field  is  required  and  must  be  a  string
  828.        constant, though the null string ("") is legal.  This  title
  829.        is  printed  after  every  page  ejection  in  the  listing,
  830.        therefore, if page ejections have not been forced by the PAG
  831.        pseudo-op,  the  title will never be printed.  The following
  832.        statement would print the title "Random Bug Generator -- Ver
  833.        3.14159" at the top of every page of the listing:
  834.  
  835.                TTL     "Random Bug Generator -- Ver 3.14159"
  836.  
  837.        Subsequent title lines are used as subtitles.
  838.  
  839.        5.19  Pseudo-ops -- PAGT
  840.  
  841.        Set the subtitle line to "string".  This line is printed  on
  842.        the  line  following the TTL line on the listing after every
  843.        page ejection. May be changed many times.
  844.  
  845.                     PAGT    "string"
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.  
  854.                                  Page 12
  855.  
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  
  863.  
  864.  
  865.  
  866.        6.  Assembly Errors
  867.  
  868.        When a source line contains an illegal construct,  the  line
  869.        is   flagged  in  the  listing  with  a  single-letter  code
  870.        describing the error.  The meaning of each  code  is  listed
  871.        below.   In  addition,  a  count of the number of lines with
  872.        errors is kept and printed on  the  C  "stderr"  device  (by
  873.        default,  the console) after the END statement is processed.
  874.        If more than one error occurs in  a  given  line,  only  the
  875.        first  is reported.  For example, the illegal label "=$#*'("
  876.        would generate the following listing line:
  877.  
  878.                L   0000        FF 00 00        =$#*'(  LDI16   DE,1000H
  879.  
  880.        6.1  Error * -- Illegal or Missing Statement
  881.  
  882.        This error occurs when either:
  883.  
  884.        1)      the assembler reaches the end  of  the  source  file
  885.                without seeing an END statement, or
  886.  
  887.        2)      an END statement is encountered in a USE file.
  888.  
  889.        If you are "sure" that the END statement is present when the
  890.        assembler  thinks  that it is missing, it probably is in the
  891.        ignored section of an IF block.  If  the  END  statement  is
  892.        missing,  supply it.  If the END statement is in a USE file,
  893.        delete it.
  894.  
  895.        6.2  Error ( -- Parenthesis Imbalance
  896.  
  897.        For  every  left  parenthesis,  there  must   be   a   right
  898.        parenthesis.  Count them.
  899.  
  900.        6.3  Error `` -- Missing Quotation Mark
  901.  
  902.        Strings have to begin and end with either " or '.   Remember
  903.        that " only matches " while ' only matches '.
  904.  
  905.        6.4  Error D -- Illegal Digit
  906.  
  907.        This error occurs if a digit greater than or  equal  to  the
  908.        base  of a numeric constant is found.  For example, a 2 in a
  909.        binary number would cause a D error.  Especially, watch  for
  910.        8 or 9 in an octal number.
  911.  
  912.  
  913.  
  914.  
  915.  
  916.  
  917.  
  918.  
  919.  
  920.                                  Page 13
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.  
  931.  
  932.        6.5  Error E -- Illegal Expression
  933.  
  934.        This error occurs because of:
  935.  
  936.        1)      a missing expression where one is required
  937.  
  938.        2)      a unary operator used as a binary operator or  vice-
  939.                versa
  940.  
  941.        3)      a missing binary operator
  942.  
  943.        4)      a SHL or SHR count that is not 0 thru 15
  944.  
  945.        6.6  Error I -- IF-ENF Imbalance
  946.  
  947.        For every IF there must be a  corresponding  ENF.   If  this
  948.        error  occurs  on an ELS or ENF statement, the corresponding
  949.        IF is missing.  If this error occurs on  an  END  statement,
  950.        one or more ENF statements are missing.
  951.  
  952.        6.7  Error L -- Illegal Label
  953.  
  954.        This error occurs because of:
  955.  
  956.        1)      a non-alphabetic in column 1
  957.  
  958.        2)      a reserved word used as a label
  959.  
  960.        3)      a missing label on an EQU, or SET statement
  961.  
  962.        4)      a label on an IF, ELS, or ENF statement
  963.  
  964.        6.8  Error M -- Multiply Defined Label
  965.  
  966.        This error occurs because of:
  967.  
  968.        1)      a  label  defined  in  column  1  or  with  the  EQU
  969.                statement being redefined
  970.  
  971.        2)      a label defined by a SET statement  being  redefined
  972.                either in column 1 or with the EQU statement
  973.  
  974.        3)      the value of the  label  changing  between  assembly
  975.                passes
  976.  
  977.        6.9  Error O -- Illegal Opcode
  978.  
  979.        The opcode field of a source line may contain only  a  valid
  980.        machine  opcode,  a  valid  pseudo-op,  or  nothing  at all.
  981.        Anything else causes this error.
  982.  
  983.  
  984.  
  985.  
  986.                                  Page 14
  987.  
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  
  995.  
  996.  
  997.  
  998.        6.10  Error P -- Phasing Error
  999.  
  1000.             This error occurs because of:
  1001.  
  1002.        1)      a forward reference in a EQU, ORG, or SET statement
  1003.  
  1004.        2)      a label disappearing between assembly passes
  1005.  
  1006.        6.11  Error S -- Illegal Syntax
  1007.  
  1008.        This error means that an argument field is scrambled.   Sort
  1009.        the mess out and reassemble.  In particular, look for use of
  1010.        registers that don't apply to a particular  opcode,  missing
  1011.        commas, and the like.
  1012.  
  1013.        6.12  Error T -- Too Many Arguments
  1014.  
  1015.        This error occurs if  there  are  more  items  (expressions,
  1016.        register  designators,  etc.) in the argument field than the
  1017.        opcode or pseudo-op requires.   The  assembler  ignores  the
  1018.        extra  items  but  issues  this  error  in case something is
  1019.        really mangled.
  1020.  
  1021.        6.13  Error U -- Undefined Label
  1022.  
  1023.        This error occurs if a label is referenced in an  expression
  1024.        but  not defined anywhere in the source program.  If you are
  1025.        "sure" you have defined the label, note that upper and lower
  1026.        case letters in labels are different.  Defining "LABEL" does
  1027.        not define "Label."
  1028.  
  1029.        6.14  Error V -- Illegal Value
  1030.  
  1031.        This error occurs because:
  1032.  
  1033.        1)      an 8 bit immediate value is not -128 thru 255, or
  1034.  
  1035.        2)      a DC argument is not -128 thru 255, or
  1036.  
  1037.        3)      a USE argument refers to a file that does not exist.
  1038.  
  1039.  
  1040.        7.  Warning Messages
  1041.  
  1042.        Some errors that occur during  the  parsing  of  the  cross-
  1043.        assembler  command  line are non-fatal.  The cross-assembler
  1044.        flags these with a message on  the  C  "stdout"  device  (by
  1045.        default,  the  console)  beginning  with the word "Warning."
  1046.        The messages are listed below:
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.                                  Page 15
  1053.  
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060.  
  1061.  
  1062.  
  1063.  
  1064.        7.1  red
  1065.  
  1066.        The cross-assembler will only assemble one file at  a  time,
  1067.        so  source  file  names  after  the  first  are ignored.  To
  1068.        assemble a second file, invoke the  assembler  again.   Note
  1069.        that  under  CP/M-  80,  the old trick of reexecuting a core
  1070.        image will NOT work as the initialized data  areas  are  not
  1071.        reinitialized prior to the second run.
  1072.  
  1073.        7.5  Warning -- Extra Listing File Ignored
  1074.  
  1075.        7.6  Warning -- Extra Object File Ignored
  1076.  
  1077.        The cross-assembler  will  only  generate  one  listing  and
  1078.        object file per assembly run, so -l and -o options after the
  1079.        first are ignored.
  1080.  
  1081.  
  1082.        8.  Fatal Error Messages
  1083.  
  1084.        Several errors that occur during the parsing of  the  cross-
  1085.        assembler command line or during the assembly run are fatal.
  1086.        The cross-assembler flags these with  a  message  on  the  C
  1087.        "stdout" device (by default, the console) beginning with the
  1088.        words "Fatal Error."  The messages are explained below:
  1089.  
  1090.        8.1  Fatal Error -- No Source File Specified
  1091.  
  1092.        This one is self-explanatory.  The assembler does  not  know
  1093.        what to assemble.
  1094.  
  1095.        8.2  Fatal Error -- Source File Did Not Open
  1096.  
  1097.        The assembler could not open  the  source  file.   The  most
  1098.        likely  cause  is  that  the source file as specified on the
  1099.        command line does not exist.  On larger systems, there could
  1100.        also  be priviledge violations.  Rarely, a read error in the
  1101.  
  1102.  
  1103.  
  1104.                                  Page 16
  1105.  
  1106.  
  1107.  
  1108.  
  1109.  
  1110.  
  1111.  
  1112.  
  1113.  
  1114.  
  1115.  
  1116.        disk directory could cause this error.
  1117.  
  1118.        8.3  Fatal Error -- Listing File Did Not Open
  1119.  
  1120.        8.4  Fatal Error -- Object File Did Not Open
  1121.  
  1122.        This error indicates either a defective  listing  or  object
  1123.        file  name  or a full disk directory.  Correct the file name
  1124.        or make more room on the disk.
  1125.  
  1126.        8.5  Fatal Error -- Error Reading Source File
  1127.  
  1128.        This error generally indicates a read error in the disk data
  1129.        space.  Use your backup copy of the source file (You do have
  1130.        one,  don't  you?)  to  recreate  the   mangled   file   and
  1131.        reassemble.
  1132.  
  1133.        8.6  Fatal Error -- Disk or Directory Full
  1134.  
  1135.        This one is self-explanatory.  Some more space must be found
  1136.        either  by  deleting files or by using a disk with more room
  1137.        on it.
  1138.  
  1139.        8.7  Fatal Error -- File Stack Overflow
  1140.  
  1141.        This error occurs if you exceed the INCLude  file  limit  of
  1142.        four files open simultaneously.  This limit can be increased
  1143.        by  increasing  the  constant  FILES  in  file  z80a.H   and
  1144.        recompiling the cross-assembler.
  1145.  
  1146.        8.8  Fatal Error -- If Stack Overflow
  1147.  
  1148.        This error occurs if you exceed the nesting limit of  16  IF
  1149.        blocks.   This  limit  can  be  increased  by increasing the
  1150.        constant IFDEPTH in file z80a.H and recompiling  the  cross-
  1151.        assembler.
  1152.  
  1153.        8.9  Fatal Error -- Too Many Symbols
  1154.  
  1155.        Congratulations!  You have run out of memory.  The space for
  1156.        the  cross-assembler's symbol table is allocated at run-time
  1157.        using  the  C  library  function  malloc(),  so  the  cross-
  1158.        assembler will use all available memory.  The only solutions
  1159.        to this problem are to lessen the number of  labels  in  the
  1160.        source program or to add more memory.
  1161.  
  1162.  
  1163.  
  1164.  
  1165.  
  1166.  
  1167.  
  1168.  
  1169.  
  1170.                                  Page 17
  1171.  
  1172.  
  1173.  
  1174.  
  1175.  
  1176.  
  1177.  
  1178.  
  1179.  
  1180.  
  1181.  
  1182.                       Appendix I - Z80 Opcode Table
  1183.  
  1184.  
  1185.  
  1186.        FORMAT       ENCODING   ZILOG FORM   COMMENT
  1187.  
  1188.        ADC r                   ADC A,r
  1189.        ADCI n                  ADC A,n
  1190.        ADCHL d                 ADC HL,d
  1191.                                             d may be BC,
  1192.                                             DE, HL, SP
  1193.        ADD r                   ADD A,r
  1194.        ADDI n                  ADD A,n
  1195.        ADDHL d                 ADD HL,d
  1196.                                             d may be BC,
  1197.                                             DE, HL, SP
  1198.        ADDIX d                 ADD IX,d
  1199.                                             d may be BC,
  1200.                                             DE, IX, SP
  1201.        ADDIY d                 ADD IY,d
  1202.                                             d may be BC,
  1203.                                             DE, IY, SP
  1204.        AND r                   AND A,r
  1205.        ANDI n                  AND A,n
  1206.        BIT b;r                 BIT b,r
  1207.        CALL nn                 CALL nn
  1208.        CALLC c;nn              CALL c,nn
  1209.        CCF                     CCF
  1210.        CMP r                   CP r
  1211.        CP r                    CP r
  1212.                                             alternate
  1213.                                             form of CMP
  1214.        CMPI n                  CP n
  1215.        CPDEC                   CPD
  1216.        CPDR                    CPDR
  1217.        CPINC                   CPI
  1218.        CPIR                    CPIR
  1219.        CPL                     CPL
  1220.        DAA                     DAA
  1221.        DEC r                   DEC r
  1222.        DEC16 d                 DEC d
  1223.                                             d may be BC,
  1224.                                             DE,  HL, IX,
  1225.                                             IY, SP
  1226.        DI                      DI
  1227.        DJNZ nn                 DJNZ nn
  1228.                                             The
  1229.                                             assembler
  1230.                                             fills in the
  1231.                                             displacement.
  1232.                                             nn  is   the
  1233.                                             actual
  1234.                                             address   to
  1235.                                             jump to.
  1236.        EI                      EI
  1237.        EXSPHL                  EX (SP),HL
  1238.  
  1239.  
  1240.  
  1241.  
  1242.  
  1243.                                                        Appendix I-1
  1244.  
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.        FORMAT       ENCODING   ZILOG FORM   COMMENT
  1256.  
  1257.        EXSPIX                  EX (SP),IX
  1258.        EXSPIY                  EX (SP),IY
  1259.        EXAFAF                  EX AF,AF'
  1260.        EXDEHL                  EX DE,HL
  1261.        EXX                     EXX
  1262.        HALT                    HALT
  1263.        IM0                     IM 0
  1264.        IM1                     IM 1
  1265.        IM2                     IM 2
  1266.        IN n                    IN A,(n)
  1267.        INPUT r                 IN r,(C)
  1268.                                             r may be  A,
  1269.                                             B,  C, D, E,
  1270.                                             H, L
  1271.        INC r                   INC r
  1272.        INC16 d                 INC d
  1273.        INDEC                   IND
  1274.        INDR                    INDR
  1275.        ININC                   INI
  1276.        INIR                    INIR
  1277.        JUMP nn                 JP nn
  1278.        JP c;nn                 JP c,nn
  1279.        JUMPI d                 JP (d)
  1280.                                             d may be HL,
  1281.                                             IX, IY
  1282.        JREL nn                 JR nn
  1283.                                             nn  is   the
  1284.                                             location  to
  1285.                                             jump to
  1286.        JR c;nn                 JR c,nn
  1287.        LD r1;r2                LD r1,r2
  1288.        LDI r;n                 LD r,n
  1289.        LDABC                   LD A,(BC)
  1290.        LDADE                   LD A,(DE)
  1291.        LDBCA                   LD (BC),A
  1292.        LDDEA                   LD (DE),A
  1293.        LDA nn                  LD A,(nn)
  1294.        STA nn                  LD (nn),A
  1295.        LDI16 d;nn              LD d,nn
  1296.                                             d may be BC,
  1297.                                             DE,  HL, IX,
  1298.                                             IY, SP
  1299.        LD16 d;nn               LD d,(nn)
  1300.        ST16 nn;d               LD (nn),d
  1301.        LDAI                    LD A,I
  1302.        LDAR                    LD A,R
  1303.        LDIA                    LD I,A
  1304.        LDRA                    LD R,A
  1305.  
  1306.  
  1307.        LDSP d                  LD SP,d
  1308.  
  1309.  
  1310.  
  1311.  
  1312.  
  1313.                                                        Appendix I-2
  1314.  
  1315.  
  1316.  
  1317.  
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324.  
  1325.        FORMAT       ENCODING   ZILOG FORM   COMMENT
  1326.  
  1327.                                             d may be HL,
  1328.                                             IX, IY
  1329.        LDDEC                   LDD
  1330.        LDDR                    LDDR
  1331.        LDINC                   LDI
  1332.        LDIR                    LDIR
  1333.        NEG                     NEG
  1334.        NOP                     NOP
  1335.        OR r                    OR A,r
  1336.        ORI n                   OR A,n
  1337.        OUTDR                   OTDR
  1338.        OUTINC                  OUTI
  1339.        OUTIR                   OTIR
  1340.        OUT n                   OUT (n),A
  1341.        OUTPUT r                OUT (C),r
  1342.        POP d                   POP d
  1343.                                             d may be AF,
  1344.                                             BC,  DE, HL,
  1345.                                             IX, IY
  1346.        PUSH d                  PUSH d
  1347.                                             d may be AF,
  1348.                                             BC,  DE, HL,
  1349.                                             IX, IY
  1350.        RES b;r                 RES b,r
  1351.        RETURN                  RET
  1352.        RET c                   RET c
  1353.        RETI                    RETI
  1354.        RETN                    RETN
  1355.        RL r                    RL r
  1356.        RLA                     RLA
  1357.                                             (short  form
  1358.                                             RL A)
  1359.        ROLC r                  RLC r
  1360.        RLCA                    RLCA
  1361.                                             (short  form
  1362.                                             of RLC A)
  1363.        RLD                     RLD
  1364.        RR r                    RR r
  1365.        RRA                     RRA
  1366.                                             (short  form
  1367.                                             of RR A)
  1368.        RRC r                   RRC r
  1369.        RRCA                    RRCA
  1370.                                             (short  form
  1371.                                             of RRC A)
  1372.        RRD                     RRD
  1373.        RST x                   RST x
  1374.                                             x may be  0,
  1375.                                             8,       16,
  1376.                                             24,...,56
  1377.        SBC r                   SBC A,r
  1378.        SBCI n                  SBC A,n
  1379.  
  1380.  
  1381.        SBCHL d                 SBC HL,d
  1382.  
  1383.  
  1384.  
  1385.  
  1386.  
  1387.                                                        Appendix I-3
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393.  
  1394.  
  1395.  
  1396.  
  1397.  
  1398.  
  1399.        FORMAT       ENCODING   ZILOG FORM   COMMENT
  1400.  
  1401.                                             d may be BC,
  1402.                                             DE, HL, SP
  1403.        SCF                     SCF
  1404.        SETB b;r                SET b,r
  1405.        SLA r                   SLA r
  1406.        SRA r                   SRA r
  1407.        SRL r                   SRL r
  1408.        SUB r                   SUB A,r
  1409.        SUBI n                  SUN A,n
  1410.        XOR r                   XOR A,r
  1411.        XORI n                  XOR A,n
  1412.  
  1413.  
  1414.  
  1415.  
  1416.  
  1417.  
  1418.  
  1419.  
  1420.  
  1421.  
  1422.  
  1423.  
  1424.  
  1425.  
  1426.  
  1427.  
  1428.  
  1429.  
  1430.  
  1431.  
  1432.  
  1433.  
  1434.  
  1435.  
  1436.  
  1437.  
  1438.  
  1439.  
  1440.  
  1441.  
  1442.  
  1443.  
  1444.  
  1445.  
  1446.  
  1447.  
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.                                                        Appendix I-4
  1455.  
  1456.  
  1457.  
  1458.  
  1459.  
  1460.  
  1461.  
  1462.  
  1463.  
  1464.  
  1465.  
  1466.        NOTES:
  1467.  
  1468.             8-bit registers (r):
  1469.             A
  1470.             B
  1471.             C
  1472.             D
  1473.             E
  1474.             H
  1475.             L
  1476.             M       This is (HL) in Zilog terms
  1477.             IX,0    This is (IX+0)
  1478.             IY,0    This is (IY+0)
  1479.  
  1480.             16-bit registers (d):
  1481.             BC      B & C pair
  1482.             DE      D & E pair
  1483.             HL      H & L pair
  1484.             IX      Index X
  1485.             IY      Index Y
  1486.             SP      Stack Pointer
  1487.             AF      Accumulator & Flags
  1488.  
  1489.             Condition flags (c):
  1490.             Z or EQ Zero/Equal
  1491.             NZ or NE        Nonzero/Notequal
  1492.             C
  1493.             NC
  1494.             P
  1495.             M
  1496.             PE
  1497.             PO
  1498.  
  1499.             n and nn are immediate expressions. n means an 8-bit value.
  1500.             nn means a 16-bit address or value.
  1501.  
  1502.             b refers to a bit position between 0 and 7. It may be
  1503.             an expression evaluating to a number between 0 and 7.
  1504.  
  1505.             Relative jumps allow only Z (EQ), NZ (NE),
  1506.             C and NC for the condition (c).
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514.  
  1515.  
  1516.  
  1517.  
  1518.  
  1519.  
  1520.                                                        Appendix I-5
  1521.  
  1522.  
  1523.  
  1524.  
  1525.  
  1526.  
  1527.  
  1528.  
  1529.  
  1530.  
  1531.  
  1532.                         Appendix II - Portability
  1533.  
  1534.        This cross-assembler package has been compilied and  run  on
  1535.        the following machines:
  1536.  
  1537.        1.      MS DOS 2.x 3.x - Using Microsoft 'C' Version 3.0 and
  1538.                5.1
  1539.  
  1540.        2.      Altos System V UNIX - using makefile
  1541.  
  1542.        3.      Xenix 3.0 - Using makefile
  1543.  
  1544.  
  1545.  
  1546.  
  1547.        Legal Note: This package may be used for any  commercial  or
  1548.                    non-commercial  purpose.   It  may be copied and
  1549.                    distributed freely provided that any fee charged
  1550.                    by  the  distributor of the copy does not exceed
  1551.                    the sum of:  1) the cost of the media  the  copy
  1552.                    is   written  on,   2)  any  required  costs  of
  1553.                    shipping the copy, and  3)  a  nominal  handling
  1554.                    fee.    Any   other  distribution  requires  the
  1555.                    written permission of  the  author.   Also,  the
  1556.                    author's  copyright notices shall not be removed
  1557.                    from the program source, the program object,  or
  1558.                    the program documentation.
  1559.  
  1560.  
  1561.  
  1562.  
  1563.  
  1564.  
  1565.  
  1566.  
  1567.  
  1568.  
  1569.  
  1570.  
  1571.  
  1572.  
  1573.  
  1574.  
  1575.  
  1576.  
  1577.  
  1578.  
  1579.  
  1580.  
  1581.  
  1582.  
  1583.  
  1584.  
  1585.  
  1586.                                                       Appendix II-1
  1587.  
  1588.  
  1589.  
  1590.  
  1591.  
  1592.  
  1593.  
  1594.  
  1595.  
  1596.  
  1597.  
  1598.                                  CONTENTS
  1599.  
  1600.  
  1601.        1.  Introduction........................................   1
  1602.  
  1603.        2.  How to Use the Cross-Assembler......................   1
  1604.  
  1605.        3.  Format of Cross-Assembler Source Lines..............   2
  1606.            3.1   Labels........................................   3
  1607.            3.2   Numeric Constants.............................   4
  1608.            3.3   String Constants..............................   5
  1609.            3.4   Expressions...................................   6
  1610.  
  1611.        4.  Machine Opcodes.....................................   7
  1612.  
  1613.        5.  Pseudo Opcodes......................................   7
  1614.            5.1   Pseudo-ops -- DC and DATA.....................   7
  1615.            5.2   Pseudo-ops -- DA..............................   8
  1616.            5.3   Pseudo-ops -- DAC.............................   8
  1617.            5.4   Pseudo-ops -- CSECT...........................   8
  1618.            5.5   Pseudo-ops -- NCODE...........................   8
  1619.            5.6   Pseudo-ops -- CODE............................   9
  1620.            5.7   Pseudo-ops -- END.............................   9
  1621.            5.8   Pseudo-ops -- EQU.............................   9
  1622.            5.9   Pseudo-ops -- IF, ELS, ENF....................   9
  1623.            5.10  Pseudo-ops -- USE.............................  10
  1624.            5.11  Pseudo-ops -- ORG and RLC.....................  11
  1625.            5.12  Pseudo-ops -- URLC............................  11
  1626.            5.13  Pseudo-ops -- PAG.............................  11
  1627.            5.14  Pseudo-ops -- SKP.............................  11
  1628.            5.15  Pseudo-ops -- TYP.............................  12
  1629.            5.16  Pseudo-ops -- LIST and ULIST..................  12
  1630.            5.17  Pseudo-ops -- SET.............................  12
  1631.            5.18  Pseudo-ops -- TTL.............................  12
  1632.            5.19  Pseudo-ops -- PAGT............................  12
  1633.  
  1634.        6.  Assembly Errors.....................................  13
  1635.            6.1   Error * -- Illegal or Missing Statement.......  13
  1636.            6.2   Error ( -- Parenthesis Imbalance..............  13
  1637.            6.3   Error `` -- Missing Quotation Mark............  13
  1638.            6.4   Error D -- Illegal Digit......................  13
  1639.            6.5   Error E -- Illegal Expression.................  14
  1640.            6.6   Error I -- IF-ENF Imbalance...................  14
  1641.            6.7   Error L -- Illegal Label......................  14
  1642.            6.8   Error M -- Multiply Defined Label.............  14
  1643.            6.9   Error O -- Illegal Opcode.....................  14
  1644.            6.10  Error P -- Phasing Error......................  15
  1645.            6.11  Error S -- Illegal Syntax.....................  15
  1646.            6.12  Error T -- Too Many Arguments.................  15
  1647.            6.13  Error U -- Undefined Label....................  15
  1648.            6.14  Error V -- Illegal Value......................  15
  1649.  
  1650.  
  1651.  
  1652.                                   - i -
  1653.  
  1654.  
  1655.  
  1656.  
  1657.  
  1658.  
  1659.  
  1660.  
  1661.  
  1662.  
  1663.  
  1664.        7.  Warning Messages....................................  15
  1665.            7.1   Warning -- Illegal Option Ignored.............  16
  1666.            7.2   Warning -- -l Option Ignored -- No File
  1667.                  Name..........................................  16
  1668.            7.3   Warning -- -o Option Ignored -- No File
  1669.                  Name..........................................  16
  1670.            7.4   Warning -- Extra Source File Ignored..........  16
  1671.            7.5   Warning -- Extra Listing File Ignored.........  16
  1672.            7.6   Warning -- Extra Object File Ignored..........  16
  1673.  
  1674.        8.  Fatal Error Messages................................  16
  1675.            8.1   Fatal Error -- No Source File Specified.......  16
  1676.            8.2   Fatal Error -- Source File Did Not Open.......  16
  1677.            8.3   Fatal Error -- Listing File Did Not Open......  17
  1678.            8.4   Fatal Error -- Object File Did Not Open.......  17
  1679.            8.5   Fatal Error -- Error Reading Source File......  17
  1680.            8.6   Fatal Error -- Disk or Directory Full.........  17
  1681.            8.7   Fatal Error -- File Stack Overflow............  17
  1682.            8.8   Fatal Error -- If Stack Overflow..............  17
  1683.            8.9   Fatal Error -- Too Many Symbols...............  17
  1684.  
  1685.        Appendix I - Z80 Opcode Table...........................   1
  1686.  
  1687.        Appendix II - Portability...............................   1
  1688.  
  1689.  
  1690.  
  1691.  
  1692.  
  1693.  
  1694.  
  1695.  
  1696.  
  1697.  
  1698.  
  1699.  
  1700.  
  1701.  
  1702.  
  1703.  
  1704.  
  1705.  
  1706.  
  1707.  
  1708.  
  1709.  
  1710.  
  1711.  
  1712.  
  1713.  
  1714.  
  1715.  
  1716.  
  1717.  
  1718.                                   - ii -
  1719.  
  1720.  
  1721.  
  1722.  
  1723.