home *** CD-ROM | disk | FTP | other *** search
/ ftp.whtech.com / ftp.whtech.com.tar / ftp.whtech.com / compuserve / Basic / PCCHAS.ZIP / PCCHASM.TXT < prev    next >
Text File  |  1995-01-08  |  13KB  |  389 lines

  1.                                  PCCHASM v2.1
  2.  
  3. ACKNOWLEDGEMENTS
  4.  
  5. This assembler is based upon CHASM, the symbolic assembler produced by Colin
  6. Hinson for native execution on 9900 based systems. Many thanks to colin for
  7. access to his source code and for compatability testing.
  8.  
  9.  
  10. DOS COMMAND LINE
  11.  
  12. PCCHASM file [-options...]
  13.  
  14. where options are:  B     compressed object output
  15.                     C     case-sensitive symbols
  16.                     J     allow far jumps
  17.                     K     use K tag for idt
  18.                     Lnn   max label length nn, default=6
  19.                     M     MDEX compatabitity mode
  20.                     S     local symbols in object
  21.                     Tnnnn symbol table size, default=2000
  22.                     X     symbol cross-reference
  23.  
  24. multiple options may seperated by blanks, each option string must be preceeded
  25. by either a '-' or '/' character. The options are case insensitive.
  26. the enviroment variable 'PCCHASM', if it exists, will be processed as though
  27. it were an option string on the command line.
  28.  
  29. The assembler processes the source file 'file.ASM' and produces a tagged
  30. object file in 'file.OBJ' and a listing file in 'file.LST'.
  31.  
  32.  
  33. OPTION B
  34.   The tagged object output file is in compressed format, the K option
  35.   is ineffective if the B option is used. No checksum characters will be
  36.   generated for commpressed object.
  37.  
  38. OPTION C
  39.   This option causes the assembler to be case sensitive with regards to user
  40.   symbols. Pre-defined mnemonics, directives and symbols are always case
  41.   insensitive.
  42.  
  43. OPTION J
  44.   This option allows the use of jumps to locations beyond the normal
  45.   -128 .. +127 words. Far jumps are coded as an inverse jump followed
  46.   by a branch to the desired location eg:
  47.  
  48.  
  49.          FRED   JNE   THERE        ; very long way for a jump
  50.                 BSS   4000
  51.          THERE  A     R6,R4
  52.  
  53.    would be assembled as though the source code was
  54.  
  55.          FRED   JEQ   $+4          ; very long way for a jump
  56.                 JMP   THERE
  57.                 BSS   4000
  58.          THERE  A     R6,R4
  59.  
  60. OPTION K
  61.   This option causes the tagged object to have the 'K' tag for the IDT rather
  62.   than the standard '0' tag. This option is not available if the 'B' option is
  63.   used.
  64.  
  65. OPTION L
  66.   This option is immediately followed by a one or two digit decimal number in
  67.   the range 6..32. This option sets the maximum symbol length that may be used
  68.   by the assembler. The default maximum symbol length is 6 characters. The
  69.   symbol length will be truncated to 6 characters when output in the tagged
  70.   object file.
  71.  
  72. OPTION M
  73.   This option causes the assembler to accept MDEX compatible source, the main
  74.   differences are:
  75.     a. Numeric values with a leading '0' are assumed hex.
  76.     b. labels followed by a '*' are DEF'd.
  77.     c. UDEF is automatically in effect.
  78.  
  79. OPTION S
  80.   This option caused the local symbols to be output in the object file
  81.   using the 'G' and 'H' tags.
  82.  
  83. OPTION T
  84.   This option is immediately followed by a decimal number.
  85.   This option sets the maximum number of symbols (memory permitting) that
  86.   may appear in one assembly. The default is 2000 symbols.
  87.  
  88. OPTION X
  89.   This option causes the assembler to produce a symbol cross-reference at the
  90.   end of the listing if sufficient memory is available. Pre-defined symbols
  91.   will not be included in the cross-reference. The symbol table listing will
  92.   be suppressed if the cross-reference is produced.
  93.  
  94.  
  95.  
  96.  
  97.  
  98.                                 SOURCE FORMAT
  99.  
  100. SPECIAL CHARACTERS
  101.   The special treatment of control characters in the source file is as
  102.   follows:
  103.     TAB - expanded to one or more spaces (8 character tab stops).
  104.     ^Z  - End of file.
  105.     CR  - End of line.
  106.     LF  - End of line.
  107.     NUL - End of line.
  108.  
  109.   All characters with the msb set and un-listed control characters will be
  110.   ignored.
  111.  
  112. COMMENT LINES
  113.   A line starting with a '*',';' or '.' is treated as a comment line.
  114.  
  115. LABELS
  116.   A label may optionally be followed by a ':', this is simply ignored.
  117.  
  118. NUMBERS
  119.   numbers are assumed to be decimal unless preceeded by one of the
  120.   following:
  121.      '>'  - Hex
  122.      '#'  - Hex
  123.      '%'  - Binary
  124.  
  125.   In mdex compatibilty mode a number is assumed to be hex if it begins with
  126.   a zero character.
  127.  
  128. OPERATORS
  129.   .+  OR
  130.   .*  AND
  131.   .-  NOT
  132.   ./  MOD
  133.   +   ADD
  134.   -   SUBTRACT
  135.   *   MULTIPLY
  136.   /   DIVIDE
  137.  
  138. DIRECTIVES
  139.   Directives may optionally be preceeded by a '.' character, this is simply
  140.   ignored.
  141.  
  142.  
  143. SYMBOLS
  144.   A symbol may contain the characters '0..9','A..Z','a..z','$' and '_' except
  145.   that the first character must not be numeric. The maximum symbol size is
  146.   6 characters, this may be increased to a maximum of 32 by the use of the L
  147.   option. If the C option is not used all symbols will be converted to upper
  148.   case.
  149.  
  150.  
  151.                               UNSUPPORTED ITEMS
  152.   The assembler does not support the following:
  153.     a. expressions using brackets.
  154.     b. macros.
  155.     c. PSEG/PEND,DSEG/DEND,CSEG/CEND segment directives.
  156.  
  157.  
  158.                              PSEUDO INSTRUCTIONS
  159.  
  160.   BKPT   : behaves as though a 'DXOP BKPT,15' has been processed.
  161.   CMSG   : behaves as though a 'DXOP CMSG,6' has been processed.
  162.   EKO    : behaves as though a 'DXOP EKO,11' has been processed.
  163.   FLOP   : behaves as though a 'DXOP FLOP,2' has been processed.
  164.   ISTK   : behaves as a 'LI SP,<expression>' where SP is the stack pointer
  165.            register as defined by the DSTK directive.
  166.   JSYS   : behaves as though a 'DXOP JSYS,1' has been processed.
  167.   MSG    : behaves as though a 'DXOP MSG,14' has been processed.
  168.   NOP    : equivalent to a 'JMP $+2' instruction.
  169.   POP    : the word at the top of the stack is pop and stored at the
  170.            address specified by the operand. The stack pointer is defined
  171.            by the DSTK directive.
  172.   POPJ   : the value at the top of stack is poped int R11 and then a branch
  173.            to the address in R11 is performed. The stack pointer is defined
  174.            by the DSTK directive.
  175.   POPR   : alternative mnemonic for POPR.
  176.   PSHR   : the word operand is pushed onto the stack and the stack pointer
  177.            incremented by two. The stack pointer is defined by the DSTK
  178.            directive.
  179.   PUSH   : alternative mnemonic for PSHR.
  180.   READ   : behaves as though a 'DXOP READ,13' has been processed.
  181.   RHXW   : behaves as though a 'DXOP RHXW,9' has been processed.
  182.   RT     : equivalent to a 'B *R11' instruction.
  183.   SPIN   : equivalent to a 'JMP $' instruction.
  184.   TOUT   : behaves as though a 'DXOP TOUT,7' has been processed.
  185.   WHXW   : behaves as though a 'DXOP WHXW,10' has been processed.
  186.   WNBL   : behaves as though a 'DXOP WNBL,8' has been processed.
  187.   WRIT   : behaves as though a 'DXOP WRIT,12' has been processed.
  188.  
  189.  
  190.  
  191.                                   DIRECTIVES
  192.  
  193.  AORG
  194.        <label> AORG           resume absolute code
  195.        <label> AORG *         resume absolute code
  196.        <label> AORG value     start absolute code at PC=value
  197.  
  198.  
  199.  ASMELSE
  200.        'ELSE' part of conditional assembly, see 'ASMIF' directive.
  201.  
  202.  ASMEND
  203.        End of conditional assembly section, see 'ASMIF' directive.
  204.  
  205.  ASMIF
  206.                ASMIF value
  207.  
  208.        If value is non-zero the following code will be assembled upto a
  209.        matching 'ASMELSE' or 'ASMEND' directive.
  210.        If value is zero the following code will be skipped until a matching
  211.        'ASMELSE' or 'ASMEND' is encountered. If a matching 'ASMELSE' is
  212.        encountered the code following it upto the matching 'ASMEND' will
  213.        be assembled. There must be a matching 'ASMEND' for each 'ASMIF'
  214.        directive. The 'ASMELSE' directive may ony occur between an 'ASMIF' and a
  215.        'ASMEND' and may only occur once.
  216.        Conditional assembly sections may be nested to a maximum of 20 deep.
  217.  
  218.  
  219.  BSS
  220.                BSS value
  221.        The program counter is advanced by value. No data is generated for
  222.        the skipped bytes.
  223.  
  224.  
  225.  BUN
  226.        This option causes the listing of byte directives to be truncated to
  227.        a single line.
  228.  
  229.  
  230.  BYTE
  231.                BYTE value<,value> .. <,value>
  232.  
  233.        Successive bytes are initialised to the values given.
  234.        The bytes generated are modified if the MASK directive has
  235.        been processed.
  236.  
  237.  
  238.  COPY
  239.                COPY "filename"
  240.       The specified filename is copied into the source file at the point of the
  241.       'COPY' directive. 'COPY' files may be nested to a maximum of 20 deep.
  242.       There is no limit to the number of copy files that may be used within a
  243.       single assembly but the file 'tag' characters used in the listing file may
  244.       repeat if an excessive number of files are used.
  245.  
  246.  DATA
  247.                DATA value<,value> .. <,value>
  248.  
  249.        The program counter is aligned to an even boundary and then Successive
  250.        words are initialised to the values given.
  251.  
  252.  
  253.  DEF
  254.                DEF  symbol<,symbol> .. <,symbol>
  255.  
  256.        The symbols listed are defined as public and are made available in
  257.        the tagged object.
  258.  
  259.  
  260.  DREG
  261.        This directive is ignored. Register names are always defined.
  262.  
  263.  DSTK
  264.        This directive specifies the register to use as the stack pointer
  265.        for any stack pseudo instructions that follow. The default stack
  266.        pointer is R10.
  267.  
  268.  DUN
  269.        This option causes the listing of data directives to be truncated to
  270.        a single line.
  271.  
  272.  DXOP
  273.        symbol DXOP value
  274.               DXOP symbol,value
  275.  
  276.        This directive creates a pseudo-instruction using the XOP number
  277.        specified by value. The new instruction takes the form
  278.        'symbol operand'.
  279.  
  280.  END
  281.                END
  282.                END  value
  283.        This directive terminates the source file, if the end of file is reached
  284.        an assumed 'END' directive is processed.
  285.  
  286.  ENDC
  287.        This is an alternative mnemonic for 'ASMEND'
  288.  
  289.  EQU
  290.        symbol EQU  value
  291.        The specified symbol is set to the value given. The symbol
  292.        must not already be defined.
  293.  
  294.  EVEN
  295.        The program counter is forced to be on an even boundary.
  296.  
  297.  IDT
  298.         symbol IDT
  299.                IDT 'name'
  300.        The object module will be given the specified name. The name will also
  301.        appear on the top line of each page of listing. The default idt will
  302.        be the file name being assembled.
  303.  
  304.  IFC
  305.        This is an alternative mnemonic for 'ASMIF'
  306.  
  307.  LIST
  308.        This directive resumes the generation of the listing file.
  309.  
  310.  MASK
  311.              MASK value
  312.        Any following TEXT or BYTE directive output is encrypted by
  313.        excluseive-or'ing each byte with the ms byte of the mask value.
  314.        Normal operation of the directives can be resumed by seting
  315.        value to zero.
  316.  
  317.  OPTION
  318.               OPTION option<,option> .. <,option>
  319.        This directive sets the specified assembler options.
  320.           XREF   - same as specifying the -X option on the command line
  321.           OBJ    - ignored
  322.           SYMT   - same as specifying the -S option on the command line
  323.           NOLIST - same as UNL directive.
  324.           TUNLST - same as TUN directive.
  325.           DUNLST - same as DUN directive.
  326.           BUNLST - same as BUN directive.
  327.           MUNLST - ignored.
  328.           LIST   - same as LIST directive.
  329.  
  330.  PAGE
  331.        Causes a page break in the listing file if not already at a page
  332.        boundary.
  333.  
  334.  REF
  335.                REF  symbol<,symbol> .. <,symbol>
  336.  
  337.        The symbols listed are defined as external.
  338.  
  339.  RORG
  340.        <label> RORG           resume relocatable code
  341.        <label> RORG *         resume relocatable code
  342.        <label> RORG value     start relocatable code at PC=value
  343.  
  344.  SET
  345.        symbol SET  value
  346.        The specified symbol is set to the value given. If the symbol
  347.        is already defined the old value is over-written. Similar to
  348.        'EQU' directive but may be used to create local symbols.
  349.  
  350.  TEXT
  351.        <label> TEXT operand<,operand> .. <,operand>
  352.          where operand is any byte value or text string.
  353.  
  354.       This directive causes successive bytes to be initialised with the
  355.       characters of the given string. If the string is preceeded by a '-' then
  356.       the last byte of the string will be negated. The bytes generated are
  357.       modified if the MASK directive has been processed.
  358.  
  359.  TITL
  360.                TITL 'string'
  361.       The title at the top of each page of listing will be set to the
  362.       specified string.
  363.  
  364.  TUN
  365.        This option causes the listing of text directives to be truncated to
  366.        a single line.
  367.  
  368.  UDEF
  369.        This option causes all un-defined symbols to be REF'd.
  370.  
  371.  UNL
  372.       Disable generation of the list file.
  373.  
  374.                                  ERROR CODES
  375.   O    Invalid opcode
  376.   S    Syntax error
  377.   R    Range error
  378.   D    DXOP error
  379.   C    Conditional assembly error
  380.   T    Type error
  381.   L    Label definition error
  382.   G    Unable to get number
  383.   E    Expression error
  384.   U    Undefined symbol
  385.   M    Multiply defined symbol
  386.   F    Copy file / nesting error
  387.   X    Internal/External/System symbol conflict
  388.  
  389.