home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / emulate / x_comp / tasm / tasm.doc < prev    next >
Text File  |  1989-10-08  |  169KB  |  3,878 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.                              TASM USER'S MANUAL
  10.  
  11.  
  12.       TASM - A Table Driven Cross Assembler for the MSDOS* Environment
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.                              Thomas N. Anderson
  20.                        Speech Technology Incorporated
  21.                            837 Front Street South
  22.                             Issaquah, WA   98072
  23.  
  24.                                February, 1989
  25.                                 Version 2.7
  26.  
  27.     [Speech Technology  Incorporated  manufactures electronic devices to
  28.     aid  the  visually  impaired  employing   digital  speech  synthesis
  29.     technology.]
  30.  
  31.  
  32.     TASM  software  is  Copyright (C)  1985-1989  by  Speech  Technology
  33.     Incorporated.  All rights reserved.
  34.  
  35.     This  document  is  Copyright  (C)  1985-1989  by Speech  Technology
  36.     Incorporated.   All rights  reserved.   Permission   is  granted  to
  37.     copy this document and  related software except for the source code.
  38.     The source code,  distributed  to registered  users,   may be copied
  39.     for the sole use of the registered user.
  40.  
  41.     Portions  of  TASM.EXE (C runtime library)  are Copyright  1987   by
  42.     Microsoft Corporation.
  43.  
  44.  
  45.  
  46.      * MSDOS is a trademark of Microsoft Corporation.
  47.  
  48.  
  49.     TASM - Table Driven Assembler Version 2.7                    Page 2
  50.  
  51.  
  52.     TABLE OF CONTENTS
  53.  
  54.     SECTION                                                      PAGE
  55.     _________________________________________________________________
  56.     INTRODUCTION                                                    4
  57.     INVOCATION                                                      5
  58.       File Names                                                    5
  59.       Option Flag: b - Binary Object Format                         6
  60.       Option Flag: c - Contiguous Block Output                      6
  61.       Option Flag: d - Define a Macro                               7
  62.       Option Flag: e - Expand Source                                7
  63.       Option Flag: f - Fill Memory                                  7
  64.       Option Flag: h - Hex Table                                    7
  65.       Option Flag: l - Label Table                                  7
  66.       Option Flag: m - MOS Tehcnology Object Format                 7
  67.       Option Flag: o - Set Number of Bytes per Object Record        7
  68.       Option Flag: p - Page Listing File                            8
  69.       Option Flag: q - Disable Listing File                         8
  70.       Option Flag: r - Set Read Buffer Size                         8
  71.       Option Flag: s - Enable Symbol File Generation                8
  72.       Option Flag: t - Table Name                                   8
  73.       Option Flag: x - Enable Extended Instruction Set              9
  74.     ENVIRONMENT VARIABLES                                          10
  75.       TASMTABS                                                     10
  76.       TASMOPTS                                                     10
  77.     SOURCE FILE FORMAT                                             11
  78.     EXPRESSIONS                                                    13
  79.       Labels                                                       13
  80.       Constants                                                    13
  81.       Location Counter Symbol                                      14
  82.       Operators                                                    15
  83.     ASSEMBLER DIRECTIVES                                           17
  84.       ADDINSTR                                                     17
  85.       BLOCK                                                        17
  86.       BSEG/CSEG/DSEG/NSEG/XSEG                                     17
  87.       BYTE                                                         18
  88.       CODES/NOCODES                                                18
  89.       DB                                                           18
  90.       DW                                                           18
  91.       DEFINE                                                       18
  92.       DEFCONT                                                      20
  93.       EJECT                                                        20
  94.       ELSE                                                         20
  95.       END                                                          21
  96.       ENDIF                                                        21
  97.       EQU                                                          21
  98.  
  99.     TASM - Table Driven Assembler Version 2.7                    Page 3
  100.  
  101.       EXPORT                                                       22
  102.       IFDEF                                                        22
  103.       IFNDEF                                                       23
  104.       IF                                                           23
  105.       INCLUDE                                                      23
  106.       LIST/NOLIST                                                  23
  107.       LSFIRST/MSFIRST                                              24
  108.       ORG                                                          24
  109.       PAGE/NOPAGE                                                  24
  110.       SET                                                          25
  111.       SYM/AVSYM                                                    25
  112.       TEXT                                                         26
  113.       TITLE                                                        26
  114.       WORD                                                         27
  115.     OBJECT FILE FORMATS                                            28
  116.       Intel Hex Object Format                                      28
  117.       MOS Technology Hex Object Format                             29
  118.       Binary Object Format                                         29
  119.     LISTING FILE FORMAT                                            30
  120.     PROM PROGRAMMING                                               31
  121.     ERROR MESSAGES                                                 33
  122.     BUGS AND LIMITATIONS                                           35
  123.     6502 INSTRUCTIONS AND ADDRESSING MODES                         36
  124.     8048 INSTRUCTIONS AND ADDRESSING MODES                         39
  125.     8051 INSTRUCTIONS AND ADDRESSING MODES                         44
  126.     8085 INSTRUCTIONS AND ADDRESSING MODES                         49
  127.     Z80 INSTRUCTIONS AND ADDRESSING MODES                          52
  128.     6805 INSTRUCTIONS AND ADDRESSING MODES                         58
  129.     TMS32010 INSTRUCTIONS AND ADDRESSING MODES                     64
  130.     TASM DISTRIBUTION FILES                                        71
  131.     BUILDING TASM FROM THE SOURCE CODE                             72
  132.     TASM INSTRUCTION SET TABLE DEFINITION                          73
  133.  
  134.     APPENDIX A - SAMPLE LISTING FILE                               78
  135.     APPENDIX B - SAMPLE INSTRUCTION DEFINITION TABLE (TASM65.TAB)  80
  136.     APPENDIX C - ORDERING INFORMATION                              85
  137.  
  138.     TASM - Table Driven Assembler Version 2.7                    Page 4
  139.  
  140.  
  141.     INTRODUCTION
  142.  
  143.     TASM  is a table driven cross assembler for the MS-DOS  environment.
  144.     Currently,  tables for the 6502,  8048, 8051, 8080/8085, Z80,  6805,
  145.     and TMS32010  microprocessors are supported by  STI, but the user so
  146.     inclined  may  build  tables for other 8 bit  microprocessors   (see
  147.     sections on TASM DISTRIBUTION FILES  and  TASM INSTRUCTION SET TABLE
  148.     DEFINITION for notes on reconfiguring TASM for  other processors).
  149.  
  150.     TASM characteristics include:
  151.  
  152.             1.  Powerful expression parsing (17 operators).
  153.             2.  Supports a subset of the 'C' preprocessor commands.
  154.             3.  Macro capability (through use of DEFINE directive).
  155.             4.  Multiple statements per line.
  156.             5.  Supports three object file formats (Intel Hex, MOS
  157.                     Technology Hex, and binary).
  158.             6.  Absolute code generation only.
  159.             7.  Source code available (in C).
  160.             8.  Uniform syntax  across  versions  for  different  target
  161.                     machines.
  162.             9.  Features in support  of  PROM  programming  (preset  all
  163.                     bytes  to  specified value,  output object code in a
  164.                     contiguous block).
  165.             10. Supports  extended  instructions of the Rockwell R65C02.
  166.             11. Tables  can  be   generated  for  other  microprocessors
  167.                     without having to modify the TASM executable module.
  168.             12. Capability to export symbols into a file  with a  format
  169.                     suitable for including  in  a  subsequent  assembly.
  170.             13. Capability to generate  a  symbol  table file compatible
  171.                     with the Avocet 8051 simulator.
  172.  
  173.     SHAREWARE
  174.  
  175.     TASM  is distributed as shareware.   TASM is not public domain.  The
  176.     TASM  distribution files may be freely copied (excluding the  source
  177.     code  files)  and  freely used for the purpose  of  evaluating   the
  178.     suitability  of  TASM for a given purpose.   Use of  TASM  beyond  a
  179.     reasonable evaluation period requires registration.   Prolonged  use
  180.     without registration is unethical.
  181.  
  182.  
  183.  
  184.     TASM - Table Driven Assembler Version 2.7                    Page 5
  185.  
  186.  
  187.     INVOCATION
  188.  
  189.     TASM can be invoked as  follows  (optional fields shown in brackets,
  190.     symbolic fields enclosed in <>):
  191.  
  192.         tasm -<pn> [-<option_flag>] <src_file> [<obj_file> [<lst_file>
  193.                                    [<exp_file> [<sym_file>]]]]
  194.  
  195.         Where  <option_flag> can be one or more of the following:
  196.  
  197.             -<pn>           Specify version (<pn> = part number)
  198.             -t<table>       Table (alternate form of above)
  199.             -c              Object file written as a contiguous block
  200.             -e              Show source lines after macro expansion
  201.             -f<xx>          Fill entire memory space with <xx> (hex)
  202.             -h              Produce hex table of the assembled code
  203.             -l              Produce a label table in the listing
  204.             -m              Produce object in MOS Technology format
  205.             -b              Produce object in binary (.COM) format
  206.             -p              Page the listing file
  207.             -q              Quite, disable the listing file
  208.             -r<kb>          Set read buffer size in Kbytes
  209.             -s              Write a symbol table file
  210.             -x[<m>]         Enable extended instruction set (if any)
  211.             -d<macro>       Define a macro (or just a macro label)
  212.             -o<bb>          Bytes per object record (hex)
  213.  
  214.     The file parameters are defined as follows:
  215.  
  216.     <src_file>      Source file name
  217.     <obj_file>      Object code file name
  218.     <lst_file>      Listing file name
  219.     <exp_file>      Export file name (generated only if the EXPORT
  220.                         directive is used).
  221.     <sym_file>      Symbol table file (generated only if the "-s" option
  222.                         is invoked or the SYM/AVSYM directives are used.
  223.  
  224.     The  source file must be specified.  If not,  some usage information
  225.     is  displayed.   Default  file names for all  the  other  files  are
  226.     generated  if  they are not explicitly provided.   The  filename  is
  227.     formed by taking the source filename and changing the extension   to
  228.     one of the following:
  229.  
  230.     TASM - Table Driven Assembler Version 2.7                    Page 6
  231.  
  232.  
  233.     File Type               Extension
  234.     ------------------------------------------
  235.     Object                  .OBJ
  236.     Listing                 .LST
  237.     Export                  .EXP
  238.     Symbol table            .SYM
  239.  
  240.     TASM  has  no  built-in instruction set  tables.    Instruction  set
  241.     definition files are read at run time.   TASM determines which table
  242.     to use based on the '-<pn>'  field shown above.   For example,   to
  243.     assemble the code in  a file called 'source.asm' one would enter:
  244.  
  245.             tasm -48  source.asm            for an 8048 assembly
  246.             tasm -65  source.asm            for a  6502 assembly
  247.             tasm -51  source.asm            for an 8051 assembly.
  248.             tasm -85  source.asm            for an 8085 assembly.
  249.             tasm -80  source.asm            for a  Z80  assembly.
  250.             tasm -05  source.asm            for a  6805 assembly.
  251.             tasm -32  source.asm            for a  TMS32010 assembly.
  252.  
  253.     The file name that the tables are read from is formed by taking  the
  254.     digits  specified  after  the  '-'  and  appending it to 'TASM' then
  255.     appending the '.TAB' extension.  Thus,  the '-48' flag  would  cause
  256.     the  tables  to  be  read from the file 'TASM48.TAB' (See section on
  257.     TASM INSTRUCTION SET DEFINITION).
  258.  
  259.     It  is  possible to designate tables by non numeric part numbers  if
  260.     the '-t' flag is used.  For example,  if a user built a table called
  261.     TASMF8.TAB then TASM could be invoked as follows:
  262.  
  263.             tasm -tf8 source.asm
  264.  
  265.  
  266.     Each option flag must be  preceded  by  a  dash.  Options  need  not
  267.     precede  the file names, however.  The various options are described
  268.     below:
  269.  
  270.     b  -  Binary Object Format. This option causes the object file to be
  271.     written in binary - one byte for each byte of code/data.  Note  that
  272.     no  address  information  is  included  in  the  object file in this
  273.     format.  The contiguous block (-c) output mode is forced  when  this
  274.     option is invoked.
  275.  
  276.     c - Contiguous Block Output. If this option is specified,  then  all
  277.     bytes  in the range from the lowest used byte to the highest will be
  278.     defined in the object file.  Normally,  with the default  Intel  Hex
  279.  
  280.     TASM - Table Driven Assembler Version 2.7                    Page 7
  281.  
  282.     object  format  enabled,  if  the Program Counter (PC) jumps forward
  283.     because of an .ORG directive,  the bytes skipped over will not  have
  284.     any  value  assigned  them  in  the  object  file.  With this option
  285.     enabled,  no output to the object file occurs until the end  of  the
  286.     assembly  at  which time the whole block is written.  This is useful
  287.     when using TASM to generate code that will be put  into  a  PROM  so
  288.     that  all  locations  will have a known value.  This option is often
  289.     used in conjunction with the -f option to ensure  all  unused  bytes
  290.     will have a known value.
  291.  
  292.     d - Define a Macro. Macros  are  be  defined  on  the  command  line
  293.     generally to control the assembly of various IFDEF's that are in the
  294.     source  file.  This is a convenient way to generate various versions
  295.     of object code from a single source file.
  296.  
  297.     e  -  Expand Source.   Normally TASM shows lines in the listing file
  298.     just  as  they are in the source file.   If the DEFINE directive  is
  299.     used,  however,  it is sometimes desirable to see the source  lines
  300.     after expansion.  Use the '-e' flag to accomplish this.
  301.  
  302.     f  -  Fill  Memory.  This  option  causes the memory image that TASM
  303.     maintains to be initialized to the value specified by  the  two  hex
  304.     characters  immediately  following the 'f'.  TASM maintains a memory
  305.     image that is a full 64K bytes in size (even if the target processor
  306.     cannot  utilize  that  memory  space).  Invocation  of  this  option
  307.     introduces a 2 second delay at start up (time required to initialize
  308.     all 64K bytes).   See Appendix A for an example.
  309.  
  310.     h - Hex Table. This option causes a hex table of the produced object
  311.     code to appear in the listing file.  Each line of  the  table  shows
  312.     sixteen bytes of code.  The format is shown in the sample listing in
  313.     Appendix A.
  314.  
  315.     l - Label Table. This option causes a label table to appear  in  the
  316.     listing  file.  Each  label is  shown  with its corresponding value.
  317.     Macro labels (as established  via  the  DEFINE  directives)  do  not
  318.     appear.  The format is shown in the sample listing in Appendix A.
  319.  
  320.     m - MOS Technology Object Format. This option causes the object file
  321.     to be written in MOS Technology hex format rather than  the  default
  322.     Intel  hex  format.  See  section  on  OBJECT  FILE  FORMATS  for  a
  323.     description of the format.
  324.  
  325.     o - Set Number of Bytes per Object Record.  When  generating  object
  326.     code in either the MOS Technology format or the Intel hex format,  a
  327.     default of 24 (decimal) bytes of object are defined on each  record.
  328.     This can be altered by invoking the '-o' option immediately followed
  329.  
  330.     TASM - Table Driven Assembler Version 2.7                    Page 8
  331.  
  332.     by  two  hex digits defining the number of bytes per record desired.
  333.     For example,  if 32 bytes per record are desired,  one might  invoke
  334.     TASM as:
  335.  
  336.             TASM -48 -o20 source.asm
  337.  
  338.     p - Page Listing File.  This option causes the listing file to  have
  339.     top of page headers and form feeds inserted at appropriate intervals
  340.     (every sixty lines of output).
  341.  
  342.     q - Disable Listing File.  This option  causes  all  output  to  the
  343.     listing  file  to  be  suppressed,   unless  a  .LIST  directive  is
  344.     encountered in the source file (see LIST/NOLIST directives).
  345.  
  346.     r  - Set Read Buffer Size.   This option overrides the default  read
  347.     buffer  size of 2 Kbytes.   The first hexadecimal digit  immediately
  348.     after the 'r'  is taken as the number of K bytes to allocate for the
  349.     read  buffer  (.e.g.  '-r8'    indicates an 8  Kbyte  buffer,  '-rf'
  350.     indicates a 15 Kbyte buffer).  Note that that read buffers are taken
  351.     from  the  same memory  pool as labels and macro storage,  and  that
  352.     additional  read buffers are needed if "includes"  are used.   Thus,
  353.     using  8  Kbyte  buffers may be suitable for  most  assemblies,  but
  354.     programs with large numbers  of symbols may not allow such a  value.
  355.     Also,  reducing the buffer  size to 1 Kbyte can  increase the memory
  356.     pool available for label storage, if such is needed.
  357.  
  358.     s - Enable Symbol File Generation.   If this flag is set,  a  symbol
  359.     file  is  generated at the end of the assembly.   The format of  the
  360.     file  is one line per label,  each label starts in the first  column
  361.     and  is  followed  by white space and then four  hexadecimal  digits
  362.     representing the value of the label.   The following illustrates the
  363.     format:
  364.  
  365.             label1          FFFE
  366.             label2          FFFF
  367.             label3          1000
  368.  
  369.     The symbol file name can be provided as the fifth  file name on  the
  370.     the  command line,  or the name will be generated from   the  source
  371.     file name with a '.SYM'  extension.   The symbol table file can also
  372.     be  generated  by invoking the SYM directive.   The AVSYM  directive
  373.     also  generates  the  symbol file but in  a  different  format  (see
  374.     section on ASSEMBLER DIRECTIVES).
  375.  
  376.     t  - Table Name.    As an alternative to specifying the table to use
  377.     (in the case it starts with a non-numeric).   Thus a table for an F8
  378.     might be selected as:
  379.  
  380.     TASM - Table Driven Assembler Version 2.7                    Page 9
  381.  
  382.  
  383.             TASM -tf8 source.asm
  384.  
  385.     x - Enable Extended Instruction  Set.  If  a  processor  family  has
  386.     instructions  that  are valid for only certain members,  this option
  387.     can be used to enable those beyond the  basic  standard  instruction
  388.     set.  Presently,  this  option  only  has  significance for the 6502
  389.     and  8048  versions of TASM.   The  6502  version  (TASM  -65 )  has
  390.     extended instructions for the  Rockwell R65C02  and  the  R65C00/21.
  391.     The 8048  version (TASM -48) has extended instructions for the 8041,
  392.     8022,  and 8021. A   hex  digit  may  follow  the 'x'  to indicate a
  393.     mask value used in selecting the appropriate  instruction set.   Bit
  394.     0   of the  mask selects  the  basic instruction set,   thus a '-x1'
  395.     would have no effect.   A  '-x3'  would   enable  the basic set plus
  396.     whatever instructions have bit 1 set in their  class  mask.  A  '-x'
  397.     without  a  digit  following is equivalent to a '-xf' which sets all
  398.     four of the  mask  bits.  (See  section  on  6502  INSTRUCTIONS  AND
  399.     ADDRESSING MODES for details on its extended instructions).
  400.  
  401.  
  402.     TASM - Table Driven Assembler Version 2.7                    Page 10
  403.  
  404.  
  405.     ENVIRONMENT VARIABLES
  406.  
  407.     The  TASM  environment  can be customized by  using  the  enviroment
  408.     variables listed below:
  409.  
  410.     TASMTABS.   This variable specifies the path to be searched for TASM
  411.     instruction  set definition tables.   If it is not defined then  the
  412.     table(s)  must exist in the current working directory.    If it  was
  413.     desired  to put the instruction set definition tables in a directory
  414.     called 'TASM' on a drive called 'C:',  the following statement would
  415.     be appropriate in the AUTOEXEC.BAT file:
  416.  
  417.             set TASMTABS=C:\TASM
  418.  
  419.     TASMOPTS.    This variable specifies TASM command line options  that
  420.     are to be invoked every time TASM is executed.  For example, if TASM
  421.     is  being used for 8048  assemblies with binary object  file  output
  422.     desired,   the  following  statement would  be  appropriate  in  the
  423.     AUTOEXEC.BAT file:
  424.  
  425.             set TASMOPTS=-80 -b
  426.  
  427.  
  428.  
  429.     TASM - Table Driven Assembler Version 2.7                    Page 11
  430.  
  431.  
  432.     SOURCE FILE FORMAT
  433.     Statements in the source file must conform to a  format  as  follows
  434.     (except  for assembler directive statements which are described in a
  435.     subsequent section):
  436.  
  437.             <label>  <operation>    <operand>       <comment>
  438.  
  439.     All of the fields are optional, under appropriate circumstances.  An
  440.     arbitrary amount of white space (space and tabs) can  separate  each
  441.     field  (as  long as the maximum line length of 255 characters is not
  442.     exceeded).  Each of fields are described below:
  443.  
  444.  
  445.     Label Field. If the first character of the line is alphabetic, it is
  446.     assumed  to  be  the  start  of  a label.  Subsequent characters are
  447.     accepted as part of that  label  until  a  space,  tab,  or  ':'  is
  448.     encountered.   The   assembler   assigns   a   value  to  the  label
  449.     corresponding to the current  location  counter.  Labels  can  be  a
  450.     maximum  of  13 characters long.  Labels can contain upper and lower
  451.     case letters, digits, underscores,  and periods (the first character
  452.     must  be alphabetic).  Labels are case sensitive - the label 'START'
  453.     is a different label from 'start'.
  454.  
  455.     Operation  Field.  The  operation  field  contains  an   instruction
  456.     (opcode)  mnemonic  which  specifies the action to be carried out by
  457.     the  target  processor  when  this  instruction  is  executed.   The
  458.     interpretation  of each mnemonic is dependent on the version of TASM
  459.     being used (see  section  on  OPCODES  AND  ADDRESSING  MODES).  The
  460.     operation  field  may  begin  in  any  column except the first.  The
  461.     operation field is case insensitive.
  462.  
  463.     Operand Field. The operand field specifies the data to  be  operated
  464.     on  by  the  instruction.  It may include expressions and/or special
  465.     symbols describing the  addressing  mode  to  be  used.  The  actual
  466.     format and interpretation is dependent on the target processor.  For
  467.     a description of the format for currently supported processors,  see
  468.     the section on OPCODES AND ADDRESSING MODES  for  the  processor  of
  469.     interest.
  470.  
  471.     Comment  Field.  The  comment  field always begins with a semicolon.
  472.     The rest of the line from the semicolon to the end of  the  line  is
  473.     ignored  by  TASM,  but passed on to the listing file for annotation
  474.     purposes.  The comment field must be the last field on a  line,  but
  475.     it may be the only field, starting in column one, if desired.
  476.  
  477.  
  478.  
  479.     TASM - Table Driven Assembler Version 2.7                    Page 12
  480.  
  481.  
  482.     Multiple  Statement Lines. If the backslash character is encountered
  483.     on a source line,  it is treated as a newline.  The remainder of the
  484.     line  following  the  backslash  will be processed as an independent
  485.     line of source code.  This allows one to put multiple statements  on
  486.     a line.  This facility is not so useful of itself,  but when coupled
  487.     with the capability  of  the  DEFINE  directive,  powerful  multiple
  488.     statement  macros  can  be  constructed  (see  section  on ASSEMBLER
  489.     DIRECTIVES).  Note that when  using  the  statement  separator,  the
  490.     character  immediately  following  it should be considered the first
  491.     character of a new line,  and thus must either be a start of a label
  492.     or  white space (not an instruction).  As the examples show, a space
  493.     is put between the backslash and the start of the next instruction.
  494.  
  495.  
  496.  
  497.  
  498.     Some  examples  of  valid  source  statements follow (6502 mnemonics
  499.     shown):
  500.  
  501.     label1  lda     byte1   ;get the first byte
  502.             dec     byte1
  503.             jne     label1
  504.  
  505.     ;
  506.     label2
  507.             sta     byte2,X
  508.             ; a multiple statement line follows
  509.             lda     byte1\ sta byte1+4\ lda byte2\ sta byte2+4
  510.  
  511.  
  512.  
  513.     TASM - Table Driven Assembler Version 2.7                    Page 13
  514.  
  515.  
  516.     EXPRESSIONS
  517.  
  518.     Expressions are made  up  of  various  syntactic  elements  (tokens)
  519.     combined  according  to  a set of syntactical rules.  The tokens are
  520.     summarized as follows:
  521.  
  522.             1.  Labels
  523.             2.  Constants
  524.             3.  Location Counter Symbol
  525.             4.  Operators
  526.             5.  Parenthesis
  527.  
  528.     Labels. Labels are strings of characters that have a  numeric  value
  529.     associated with them, generally representing an address.  Labels can
  530.     contain  upper  and  lower case letters,  digits,  underscores,  and
  531.     periods.  The first character must be a letter  (to  distinguish  it
  532.     from a numeric constant).  The value of a label is limited to 16 bit
  533.     precision.  Labels can contain up to 13 characters, all of which are
  534.     significant (none are ignored when looking at a label's value, as in
  535.     some assemblers).
  536.  
  537.     Constants.  Numeric constants must always begin with a decimal digit
  538.     (thus hexadecimal  constants  that  start  with  a  letter  must  be
  539.     prefixed by a '0').  The radix is determined by a letter immediately
  540.     following the digit string according to the following table:
  541.  
  542.             Radix           Suffix                  Prefix
  543.             ---------------------------------------------------
  544.             2               B or b                    %
  545.             8               O or o                    @
  546.             10              D or d (or nothing)
  547.             16              H or h                    $
  548.  
  549.     Decimal is the default radix, so decimal constants need no suffix or
  550.     prefix.
  551.  
  552.     The following representations are equivalent:
  553.  
  554.             1234H           or      $1234
  555.             100d            or      100
  556.             177400O         or      @177400
  557.             01011000b       or      %01011000
  558.  
  559.     The  prefixes  are provided for compatibility with some other source
  560.     code formats but introduce a problem of ambiguity.  Both '%' and '$'
  561.     have alternate uses  ('%'  for  modulo,  '$'  for  location  counter
  562.  
  563.     TASM - Table Driven Assembler Version 2.7                    Page 14
  564.  
  565.     symbol).  To  resolve this,  some simple rules are employed.  If the
  566.     first character following a '%' is a '0' or '1', it is assumed to be
  567.     a radix specifier and not the modulo  operator.  Similarly,  if  the
  568.     first character following a '$' is a valid hexadecimal digit,  it is
  569.     assumed to be a radix specifier and not the location  counter.  This
  570.     can  cause problems,  however.  Suppose you wanted to find the value
  571.     of the low byte of the label 'PNTR_TABLE', you might do this:
  572.  
  573.             (PNTR_TABLE%0100h)
  574.  
  575.     Here the '%' would mistakenly be taken for  a  radix  specifier.  To
  576.     correct  the  problem one need only insert a space in an appropriate
  577.     spot:
  578.  
  579.             (PNTR_TABLE % 0100h)
  580.  
  581.     Character  constants  are  single  characters  surrounded  by single
  582.     quotes (following  quote  is  optional).  The  ASCII  value  of  the
  583.     character  in the quotes is returned.  No escape provision exists to
  584.     represent non-printable characters within the quotes,  but  this  is
  585.     not  necessary  since  these  can  be  just as easily represented as
  586.     numeric  constants  (or  using  the  TEXT directive which does allow
  587.     escapes).
  588.  
  589.     String constants are one or more  characters  surrounded  by  double
  590.     quotes.  Note  that string constants are not allowed in expressions.
  591.     They are only allowable following the 'TITLE' and  'TEXT'  assembler
  592.     directives.
  593.  
  594.     Location  Counter  Symbol. The current value of the location counter
  595.     (PC) can be used in expressions by placing  a  '$'  in  the  desired
  596.     place.  The  Location Counter Symbol is allowable anywhere a numeric
  597.     constant is.  (Note that if the '$' is followed by a  decimal  digit
  598.     then  it  is  taken to be the hexadecimal radix indicator instead of
  599.     the Location Counter symbol,  as mentioned above).  The '*' may also
  600.     be  used  to  represent the location counter,  but is less preferred
  601.     because of its ambiguity with the multiplicative operator.
  602.  
  603.     TASM - Table Driven Assembler Version 2.7                    Page 15
  604.  
  605.  
  606.     Operators. Expressions can optionally contain operators  to  perform
  607.     some   alterations   or  calculations  on  particular  values.   The
  608.     operators are summarized as follows:
  609.  
  610.             Operator  Type          Description
  611.             __________________________________________
  612.             +        Additive       addition
  613.             -                       subtraction
  614.  
  615.             *        Multiplicative multiplication
  616.             /                       division
  617.             %                       modulo
  618.             <<                      logical shift left
  619.             >>                      logical shift right
  620.  
  621.             ~        Unary          bit inversion (one's complement)
  622.             -                       unary negation
  623.  
  624.             =        Relational     equal
  625.             ==                      equal
  626.             !=                      not equal
  627.             <                       less than
  628.             >                       greater than
  629.             <=                      less than or equal
  630.             >=                      greater than or equal
  631.  
  632.             &       Binary          binary 'and'
  633.             |                       binary 'or'
  634.             ^                       binary 'exclusive or'
  635.  
  636.     The syntax is much the same as in 'C' with the following notes:
  637.  
  638.             1.  No operator precedence is in effect.  Evaluation is from
  639.                     left to right unless grouped by  parenthesis  (  see
  640.                     example below).
  641.  
  642.             2.  All evaluations are done with 32 bit signed precision.
  643.  
  644.             3.  Both '=' and '==' are allowable equality checkers.  This
  645.                     is allowed   since   the  syntax  does  not  provide
  646.                     assignment capability (as '=' would normally imply).
  647.  
  648.     The relational operators return a value of 1 if the relation is true
  649.     and 0 if it is false.  Thirtytwo bit signed arithmetic is used.
  650.  
  651.     It is always a good idea to explicitly indicate the desired order of
  652.  
  653.     TASM - Table Driven Assembler Version 2.7                    Page 16
  654.  
  655.     evaluation with  parenthesis,  especially  to  maintain  portability
  656.     since  TASM does not evaluate expressions in the same manner as many
  657.     other assemblers.  To understand how it does arrive  at  the  values
  658.     for expressions, consider the following example:
  659.  
  660.             1 + 2*3 + 4
  661.  
  662.     TASM would start at the left and read the first token '1'  and  then
  663.     the  operator  '+'.  To  determine  what  to  add  to  the '1',  the
  664.     expression evaluator would be called recursively on the remainder of
  665.     the expression.  The next pass would read the '2' and '*'  and  then
  666.     call  itself again to evaluate the rest.  Another level of recursion
  667.     would take place in evaluating the '4'.  Since it is not followed by
  668.     any more operators, the recursion would start undoing itself and the
  669.     final expression would be evaluated as:
  670.  
  671.             1 + (2 * (3 + (4))) = 15
  672.  
  673.     If  the user had desired the '*'  to take precedence,  the following
  674.     could have been done:
  675.  
  676.             1 + (2*3) + 4
  677.  
  678.     Use parenthesis liberally.
  679.  
  680.     Here are some examples of valid expressions:
  681.  
  682.             (0f800H + tab)
  683.             (label_2 >> 8)
  684.             (label_3 << 8) & $f000
  685.             $ + 4
  686.             010010000100100b + 'a'
  687.             (base + ((label_4 >> 5) & (mask << 2))
  688.  
  689.     TASM - Table Driven Assembler Version 2.7                    Page 17
  690.  
  691.  
  692.     ASSEMBLER DIRECTIVES
  693.  
  694.     Most of the assembler  directives  have  a  format  similar  to  the
  695.     machine   instruction   format.   However,   instead  of  specifying
  696.     operations for the processor to carry out,  the directives cause the
  697.     assembler  to perform some function related to the assembly process.
  698.     TASM has two types of assembler directives - those  that  mimic  the
  699.     'C'  preprocessor  functions,  and  those  that  resemble  the  more
  700.     traditional assembler directive functions.  Each of  these  will  be
  701.     discussed.
  702.  
  703.     The  'C' preprocessor style directives are invoked with a '#' as the
  704.     first   character   of   the  line  followed  by   the   appropriate
  705.     directive  (just  as in 'C').  Thus,  these directives cannot have a
  706.     label preceding  them (on the same line).  Note that in the examples
  707.     directives are shown in upper case,  however,  either upper or lower
  708.     case is acceptable.
  709.  
  710.     ADDINSTR.  This  directive  can  be  used   to   define   additional
  711.     instructions for TASM to use in this assembly.  The format is:
  712.  
  713.     [<label>]  .ADDINSTR <inst> <args> <opcode> <nbytes> <modop> <class>
  714.                                                          <shift> <binor>
  715.  
  716.     The fields are separated by white space just as they would appear in
  717.     an instruction definition file as described in  TASM INSTRUCTION SET
  718.     TABLE DEFINITION.
  719.  
  720.     AVSYM.  See SYM/AVSYM.
  721.  
  722.     BLOCK. This directive causes the Instruction Pointer to advance  the
  723.     specified  number  of  bytes without assigning values to the skipped
  724.     over locations.  The format is:
  725.  
  726.             [<label>] .BLOCK        <expr>
  727.  
  728.     Some valid examples are:
  729.  
  730.             word1   .BLOCK  2
  731.             byte1   .block  1
  732.             buffer  .block  80
  733.  
  734.     BSEG/CSEG/DSEG/NSEG/XSEG.   These  directives  can  be  invoked  to
  735.     indicate  the  appropriate  address space for   symbols  and  labels
  736.     defined in the subsequent code.   The invocation of these directives
  737.     in no way affects the code generated, only provides more information
  738.  
  739.     TASM - Table Driven Assembler Version 2.7                    Page 18
  740.  
  741.     in  the  symbol  table  file if the  AVSYM  directive  is  employed.
  742.     Segment  control directives such as these are generally supported by
  743.     assemblers  that  generate relocatable object code.   TASM does  not
  744.     generate relocatable object code and does not support a link  phase,
  745.     so  these  directives have no direct effect on the resulting  object
  746.     code. The segments are defined as follows:
  747.  
  748.             Directive       Segment Description
  749.             ----------------------------------------------------
  750.             BSEG            Bit  address
  751.             CSEG            Code address
  752.             DSEG            Data address (internal RAM)
  753.             NSEG            Number or constant (EQU)
  754.             XSEG            External data address (external RAM)
  755.  
  756.  
  757.     BYTE.  This directive allows a value assignment to the byte pointed
  758.     to by the current Instruction Pointer.  The format is:
  759.  
  760.             [<label>] .BYTE   <expr>
  761.  
  762.     Only  the lower eight bits of <expr>  are used.   Multiple bytes may
  763.     be assigned by separating them with commas. Here are some examples:
  764.  
  765.             label1  .BYTE   10010110B
  766.                     .byte   'a'
  767.                     .byte   0
  768.                     .byte   100010110b,'a',0
  769.  
  770.     CODES/NOCODES.   These directives can be used to alternately turn on
  771.     or off the generation of formatted listing output with line numbers,
  772.     opcodes,  data, etc.   With NOCODES in effect,  the source lines are
  773.     sent to the listing file untouched.  This is useful around blocks of
  774.     comments that need a full 80 columns of width for clarity.
  775.  
  776.     DB.  This is alternate form of the BYTE directive.
  777.  
  778.     DW.  This is alternate form of the WORD directive.
  779.  
  780.     DEFINE.  The  DEFINE  directive  is  one of the most powerful of the
  781.     directives and allows string substitution  with  optional  arguments
  782.     (macros).  The format is as follows:
  783.  
  784.             #DEFINE  <macro_label>[(<arg_list>)]  [<macro_definition>]
  785.  
  786.             <macro_label> := character string to be expanded when found
  787.                                     in the source file.
  788.  
  789.     TASM - Table Driven Assembler Version 2.7                    Page 19
  790.  
  791.  
  792.             <arg_list>    := optional argument list for variable
  793.                                     substitution in macro expansion.
  794.  
  795.             <macro_def>   := character string to replace the occurrences
  796.                                     of <macro_label> in the source file.
  797.  
  798.  
  799.  
  800.     The simplest form of the DEFINE directive might look like this:
  801.  
  802.             #DEFINE         MLABEL
  803.  
  804.     Notice  that no substitutionary string is specified.  The purpose of
  805.     a statement like this would typically be to define a label  for  the
  806.     purpose  of  controlling some subsequent conditional assembly (IFDEF
  807.     or IFNDEF).
  808.  
  809.     A more complicated example,  performing simple  substitution,  might
  810.     look like this:
  811.  
  812.             #DEFINE         VAR1_LO         (VAR1 & 255)
  813.  
  814.     This statement would cause all occurrences of the  string  'VAR1_LO'
  815.     in the source to be substituted with '(VAR1 & 255)'.
  816.  
  817.     As  a  more  complicated  example,   using  the  argument  expansion
  818.     capability, consider this:
  819.  
  820.             #DEFINE         ADD(xx,yy)      clc\ lda xx\ adc yy\ sta xx
  821.  
  822.     If the source file then contained a line like this:
  823.  
  824.             ADD(VARX,VARY)
  825.  
  826.     It would be expanded to:
  827.  
  828.             clc\ lda VARX\ adc VARY\ sta VARX
  829.  
  830.     The above example shows the use of the backslash ('\') character  as
  831.     a  multiple  instruction  statement delimiter.  This approach allows
  832.     the definition of fairly powerful,  multiple statement  macros.  The
  833.     example shown generates 6502 instructions to add one memory location
  834.     to another.
  835.  
  836.     Some rules associated with the argument list:
  837.  
  838.  
  839.     TASM - Table Driven Assembler Version 2.7                    Page 20
  840.  
  841.             1.  Use a maximum of 10 arguments.
  842.  
  843.             2.  An argument in the DEFINE statement  must  be  a  unique
  844.                     string  (unique  on  that line) occurring only as an
  845.                     argument  elsewhere  in  the  line.   TASM  does   a
  846.                     straight  forward  search  for the occurrence of the
  847.                     specified argument strings in  the  macro_definition
  848.                     field  and  if  the  string  is  found somewhere not
  849.                     intended,  bad things  will  happen.  In  the  above
  850.                     example,  if  a  simple '(a,b)' had been used as the
  851.                     argument list instead '(xx,yy)',  then each  'a'  in
  852.                     the  definition  would be expanded (e.g.  the 'a' in
  853.                     'lda').
  854.  
  855.             3.  Each argument should be a maximum of 15 characters.
  856.  
  857.     Note that macros can be defined on the TASM command line, also, with
  858.     the '-d' option flag.
  859.  
  860.     DEFCONT.   This  directive  can be used to add to  the  last  macro
  861.     started with a DEFINE directive.   This provides a convenient way to
  862.     define long macros without running off the edge of the page. The ADD
  863.     macro shown above could be defined as follows:
  864.  
  865.             #DEFINE         ADD(xx,yy)      clc
  866.             #DEFCONT                      \ lda xx
  867.             #DEFCONT                      \ adc yy
  868.             #DEFCONT                      \ sta xx
  869.  
  870.     EJECT.  This  directive  can  be used to force a Top of Form and the
  871.     generation of a page header on the list file.  It has no  effect  if
  872.     the paging mode is off (see PAGE/NOPAGE).  The format is:
  873.  
  874.             .EJECT
  875.  
  876.     ELSE. This directive can optionally be used with IFDEF,  IFNDEF  and
  877.     IF  to  delineate  an alternate block of code to be assembled if the
  878.     block  immediately  following  the  IFDEF,   IFNDEF  or  IF  is  not
  879.     assembled.
  880.  
  881.  
  882.     TASM - Table Driven Assembler Version 2.7                    Page 21
  883.  
  884.     Here are some examples of the use of IFDEF, IFNDEF,  IF,  ELSE,  and
  885.     ENDIF:
  886.  
  887.             #IFDEF  label1
  888.             lda     byte1
  889.             sta     byte2
  890.             #ENDIF
  891.  
  892.  
  893.             #ifdef  label1
  894.             lda     byte1
  895.             #else
  896.             lda     byte2
  897.             #endif
  898.  
  899.             #ifndef label1
  900.             lda     byte2
  901.             #else
  902.             lda     byte1
  903.             #endif
  904.  
  905.             #if ($ >= 1000h)
  906.             ; generate an invalid statement to cause an error
  907.             ;  when we go over the 4K boundary.
  908.              !!! PROM bounds exceeded.
  909.             #endif
  910.  
  911.     END.   This   directive   should  follow  all  code/data  generating
  912.     statements in the source file.  It forces  the  last  record  to  be
  913.     written to the object file.  The format is:
  914.  
  915.             [<label>]       .END
  916.  
  917.     ENDIF. This directive must always follow an  IFDEF,  IFNDEF,  or  IF
  918.     directive and signifies the end of the conditional block.
  919.  
  920.     EQU. This directive can be used to  assign  values  to  labels.  The
  921.     labels  can  then  be  used  in  expressions in place of the literal
  922.     constant.  The format is:
  923.  
  924.             <label> .EQU  <expr>
  925.  
  926.     Here is an example:
  927.  
  928.  
  929.     TASM - Table Driven Assembler Version 2.7                    Page 22
  930.  
  931.             MASK    .EQU    F0H
  932.             ;
  933.                     lda     IN_BYTE
  934.                     and     MASK
  935.                     sta     OUT_BYTE
  936.  
  937.     An  alternate  form  of  'EQU'  is  '='.  The  previous  example  is
  938.     equivalent to:
  939.  
  940.             MASK    =       F0H
  941.     or
  942.             MASK    =FOH
  943.             MASK    =$FO
  944.  
  945.     White  space must exist after the label,  but none is required after
  946.     the '='.
  947.  
  948.     EXPORT.  This directive can be used to define symbols that are to be
  949.     written  to  the export file.   The symbols are written  as  equates
  950.     (using  the  .EQU  directive)  so that the  resulting  file  can  be
  951.     included in a subsequent assembly.   This feature can help  overcome
  952.     some  of  the deficiencies of TASM due to its lack of  a  relocating
  953.     linker. The format is:
  954.  
  955.     [<label>]  .EXPORT      <symbol>
  956.  
  957.     The following example illustrates the use of the EXPORT directive and
  958.     the format of the resulting export file:
  959.  
  960.     Source file:
  961.  
  962.             .EXPORT         read_byte
  963.             .EXPORT         write_byte
  964.             .EXPORT         open_file
  965.  
  966.     Resulting export file:
  967.  
  968.     read_byte       .EQU    $1243
  969.     write_byte      .EQU    $12AF
  970.     open_file       .EQU    $1301
  971.  
  972.     IFDEF.  This directive can be used to optionally assemble a block of
  973.     code.  It has the following form:
  974.  
  975.             #IFDEF  <macro_label>
  976.  
  977.     When invoked,  the list of  macro  labels  (established  via  DEFINE
  978.  
  979.     TASM - Table Driven Assembler Version 2.7                    Page 23
  980.  
  981.     directives) is searched.  If the label is found, the following lines
  982.     of  code  are  assembled.  If  not found,  the input file is skipped
  983.     until an ENDIF or ELSE directive is found.
  984.  
  985.     Lines that are skipped over still appear in the listing file,  but a
  986.     '~'  will appear immediately after the current PC and no object code
  987.     will be generated (this is applicable to IFDEF, IFNDEF, and IF).
  988.  
  989.     IFNDEF. This directive is the opposite of the IFDEF  directive.  The
  990.     block   of  code  following  is  assembled  only  if  the  specified
  991.     macro_label is undefined.  It has the following form:
  992.  
  993.             #IFNDEF  <macro_label>
  994.  
  995.     When invoked,  the list of  macro  labels  (established  via  DEFINE
  996.     directives)  is searched.  If the label is not found,  the following
  997.     lines of code are assembled.  If it is  found,  the  input  file  is
  998.     skipped until an ENDIF or ELSE directive is found.
  999.  
  1000.     IF.  This  directive  can  be used to optionally assemble a block of
  1001.     code dependent on the value of a given expression.  The format is as
  1002.     follows:
  1003.  
  1004.             #IF     <expr>
  1005.  
  1006.     If the expression <expr> evaluates to non-zero, the following block
  1007.     of code is assembled (until an ENDIF or ELSE is encountered).
  1008.  
  1009.     INCLUDE. The INCLUDE directive reads in and assembles the  indicated
  1010.     source  file.  INCLUDEs can be nested up to six levels.  This allows
  1011.     a convenient means to  keep  common  definitions,  declarations,  or
  1012.     subroutines  in  files  to  be included as needed.  The format is as
  1013.     follows:
  1014.  
  1015.             #INCLUDE        <filename>
  1016.  
  1017.     The  <filename>  must  be  enclosed in double quotes.  Here are some
  1018.     examples:
  1019.  
  1020.             #INCLUDE        "macros.h"
  1021.             #include "equates"
  1022.             #include "subs.asm"
  1023.  
  1024.     LIST/NOLIST.  These directives can be used to alternately turn the
  1025.     output to the list file on (LIST) or off (NOLIST).  The format is:
  1026.  
  1027.     TASM - Table Driven Assembler Version 2.7                    Page 24
  1028.  
  1029.  
  1030.             .LIST
  1031.             .NOLIST
  1032.  
  1033.     LSFIRST/MSFIRST.   These directives determine the byte order rule to
  1034.     be employed for the WORD directive.  The default (whether correct or
  1035.     not)   for  all  TASM versions is the least significant  byte  first
  1036.     (LSFIRST).  The following illustrates its effect:
  1037.  
  1038.             0000  34 12     .word $1234
  1039.             0002            .msfirst
  1040.             0002  12 34     .word $1234
  1041.             0004            .lsfirst
  1042.             0004  34 12     .word $1234
  1043.  
  1044.     ORG. This directive  provides  the  means  to  set  the  Instruction
  1045.     Pointer  (a.k.a.  Program Counter) to the desired value.  The format
  1046.     is:
  1047.  
  1048.             [<label>] .ORG    <expr>
  1049.  
  1050.     The <label> is optional.  The Instruction pointer  is  assigned  the
  1051.     value  of  the  expression,  <expr>.  For example,  to generate code
  1052.     starting at address 1000H, the following could be done:
  1053.  
  1054.             start   .ORG    1000H
  1055.  
  1056.     The expression  (<expr>)  may  contain  references  to  the  current
  1057.     Instruction Pointer, thus allowing various manipulations to be done.
  1058.     For  example,  to align the Instruction Pointer on the next 256 byte
  1059.     boundary, the following could be done:
  1060.  
  1061.                     .ORG  (($ + FFH) & FF00H)
  1062.  
  1063.     ORG can also be used to reserve space without assigning values:
  1064.  
  1065.                     .ORG    $+8
  1066.  
  1067.     An alternate form of ORG is '*=' or '$='.  Thus  the  following  two
  1068.     examples as exactly equivalent to the previous example:
  1069.  
  1070.                     *=*+8
  1071.                     $=$+8
  1072.  
  1073.     PAGE/NOPAGE. These directives can be used to  alternately  turn  the
  1074.     paging mode on (PAGE) or off (NOPAGE).  If paging is in effect, then
  1075.     every  sixty  lines  of  output  will  be  followed by a Top of Form
  1076.  
  1077.     TASM - Table Driven Assembler Version 2.7                    Page 25
  1078.  
  1079.     character and a two line header containing  page  number,  filename,
  1080.     and the title.  The format is:
  1081.  
  1082.             .PAGE
  1083.             .NOPAGE
  1084.  
  1085.     SET.   This directive allows the value of an existing label  to  be
  1086.     changed.  The format is:
  1087.  
  1088.             <label>   .SET    <expr>
  1089.  
  1090.     The  use  of the SET directive should be avoided since changing  the
  1091.     value of a label can sometimes cause phase errors between pass 1 and
  1092.     pass 2 of the assembly.
  1093.  
  1094.     SYM/AVSYM.    These  directives can be used to cause a symbol  table
  1095.     file to be generated.  The format is:
  1096.  
  1097.             .SYM    ["<symbol_filename>"]
  1098.             .AVSYM  ["<symbol_filename>"]
  1099.  
  1100.     For example:
  1101.  
  1102.             .SYM    "symbol.map"
  1103.             .SYM
  1104.             .AVSYM  "prog.sym"
  1105.             .AVSYM
  1106.  
  1107.     The two directives are similar,  but result in a different format of
  1108.     the  symbol table file.   The format of  the   SYM file  is one line
  1109.     per  symbol,   each  symbol  starts in the first   column   and   is
  1110.     followed   by  white  space  and  then  four   hexadecimal    digits
  1111.     representing  the  value of the symbol.    The following illustrates
  1112.     the format:
  1113.  
  1114.             label1          FFFE
  1115.             label2          FFFF
  1116.             label3          1000
  1117.  
  1118.     The AVSYM is provided to generate symbol tables compatible with  the
  1119.     Avocet  8051  simulator.   The format is similar,  but each line  is
  1120.     prefixed  by an 'AS'  and each symbol value is prefixed by a segment
  1121.     indicator:
  1122.  
  1123.  
  1124.     TASM - Table Driven Assembler Version 2.7                    Page 26
  1125.  
  1126.             AS      start           C:1000
  1127.             AS      read_byte       C:1243
  1128.             AS      write_byte      C:1280
  1129.             AS      low_nib_mask    N:000F
  1130.             AS      buffer          X:0080
  1131.  
  1132.     The  segment  prefixes  are determined by the  most  recent  segment
  1133.     directive invoked (see BSEG/CSEG/DSEG/NSEG/XSEG directives).
  1134.  
  1135.     TEXT.  This  directive  allows  an ASCII string to be used to assign
  1136.     values  to  a  sequence  of  locations  starting  at   the   current
  1137.     Instruction Pointer.  The format is:
  1138.  
  1139.             [<label>] .TEXT   "<string>"
  1140.  
  1141.     The  ASCII value of each character in <string> is taken and assigned
  1142.     to  the  next  sequential  location.   Some  escape  sequences   are
  1143.     supported as follows:
  1144.  
  1145.             Escape
  1146.             Sequence        Description
  1147.             ------------------------------
  1148.             \n              Line Feed
  1149.             \r              Carriage return
  1150.             \b              Backspace
  1151.             \t              Tab
  1152.             \f              Formfeed
  1153.             \\              Backslash
  1154.             \"              Quote
  1155.             \000            Octal value of character
  1156.  
  1157.     Here are some examples:
  1158.  
  1159.             message1  .TEXT  "Disk I/O error"
  1160.             message2  .text  "Enter file name "
  1161.                       .text  "abcdefg\n\r"
  1162.                       .text  "I said \"NO\""
  1163.  
  1164.     TASM  only  shows  the first six  bytes of the string in the listing
  1165.     file, but all bytes are included in the object file.
  1166.  
  1167.     TITLE. This directive allows the user to define a title string  that
  1168.     appears  at the top of each page of the list file (assuming the PAGE
  1169.     mode is on).  The format is:
  1170.  
  1171.                     .TITLE  "<string>"
  1172.  
  1173.  
  1174.     TASM - Table Driven Assembler Version 2.7                    Page 27
  1175.  
  1176.     The string should not exceed 80 characters.  Here are some examples:
  1177.  
  1178.                     .TITLE  "Controller version 1.1"
  1179.                     .title  "This is the title of the assembly"
  1180.                     .title  ""
  1181.  
  1182.  
  1183.     WORD. This directive allows a value assignment to the next two bytes
  1184.     pointed to by the current Instruction Pointer.  The format is:
  1185.  
  1186.             [<label>] .WORD  <expr>
  1187.  
  1188.     The  least  significant  byte  of  <expr>  is  put  at  the  current
  1189.     Instruction  Pointer  with  the  most  significant  byte at the next
  1190.     sequential location (unless the MSFIRST directive has been invoked.
  1191.     Here are some examples:
  1192.  
  1193.             data_table      .WORD   (data_table + 1)
  1194.                             .word   $1234
  1195.                             .Word   (('x' - 'a')  << 2)
  1196.                             .Word   12,55,32
  1197.  
  1198.  
  1199.     END.   This   directive   should  follow  all  code/data  generating
  1200.     statements in the source file.  It forces  the  last  record  to  be
  1201.     written to the object file.  The format is:
  1202.  
  1203.             [<label>]       .END
  1204.  
  1205.  
  1206.  
  1207.     TASM - Table Driven Assembler Version 2.7                    Page 28
  1208.  
  1209.  
  1210.     OBJECT FILE FORMATS
  1211.  
  1212.     TASM supports three object file formats:
  1213.  
  1214.             1.  Intel Hex (default).
  1215.             2.  MOS Technology Hex.
  1216.             3.  Binary
  1217.  
  1218.     Each are described below:
  1219.  
  1220.     Intel Hex Object Format. This is the default format.  This format is
  1221.     line  oriented  and  uses only printable ASCII characters except for
  1222.     the carriage return/line feed at the end of each line.  Each line in
  1223.     the file assumes the following format:
  1224.  
  1225.     :NNAAAARRHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHCCTT
  1226.  
  1227.     Where:
  1228.  
  1229.     All fields marked 'hex' consist of two  or  four  ASCII  hexadecimal
  1230.     digits  (0-9,  A-F).  A maximum of 24 data bytes will be represented
  1231.     on each line.
  1232.  
  1233.     :       = Record Start Character
  1234.     NN      = Byte Count (hex)
  1235.     AAAA    = Address of first byte (hex)
  1236.     RR      = Record Type (hex, 00 except for last record which is 01)
  1237.     HH      = Data Bytes (hex)
  1238.     CC      = Check Sum (hex)
  1239.     TT      = Line Terminator (carriage return, line feed)
  1240.  
  1241.     The last line of the file will be a record conforming to  the  above
  1242.     format with a byte count of zero (':00000001FF').
  1243.  
  1244.     The checksum is defined as:
  1245.  
  1246.             sum      =  byte_count + address_hi + address_lo +
  1247.                             record_type + (sum of all data bytes)
  1248.             checksum =  ((-sum) & ffh)
  1249.  
  1250.  
  1251.     TASM - Table Driven Assembler Version 2.7                    Page 29
  1252.  
  1253.  
  1254.     MOS  Technology  Hex Object Format. This format is line oriented and
  1255.     uses  only  printable  ASCII  characters  except  for  the  carriage
  1256.     return/line  feed  at  the  end of each line.  Each line in the file
  1257.     assumes the following format:
  1258.  
  1259.     ;NNAAAAHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHCCCCTT
  1260.  
  1261.     Where:
  1262.  
  1263.     All fields marked 'hex' consist of two  or  four  ASCII  hexadecimal
  1264.     digits  (0-9,  A-F).  A maximum of 24 data bytes will be represented
  1265.     on each line.
  1266.  
  1267.     ;       = Record Start Character
  1268.     NN      = Byte Count (hex)
  1269.     AAAA    = Address of first byte (hex)
  1270.     HH      = Data Bytes (hex)
  1271.     CCCC    = Check Sum (hex)
  1272.     TT      = Line Terminator (carriage return, line feed)
  1273.  
  1274.     The last line of the file will be a record with a byte count of zero
  1275.     (';00').
  1276.  
  1277.     The checksum is defined as:
  1278.  
  1279.             sum      =  byte_count + address_hi + address_lo +
  1280.                             record_type + (sum of all data bytes)
  1281.             checksum =  (sum & ffffh)
  1282.  
  1283.  
  1284.  
  1285.  
  1286.     Binary   Object   Format.   This  file  format  has  only  a  binary
  1287.     representation of each data byte with no address, checksum or format
  1288.     description,  whatsoever.  It is often a convenient format to use to
  1289.     pass  the  data to other programs on your PC (like a PROM programmer
  1290.     package) but because of the  non-printability and  lack  of  address
  1291.     information,  it  is  not  often  used to transmit the code to other
  1292.     systems.
  1293.  
  1294.     Note that when this object format is selected (-b  option),  the  -c
  1295.     option  is  forced.  This  is  done so that no ambiguity arises as a
  1296.     result of the lack of address information in the file.  Without  the
  1297.     -c  option,   discontinuous  blocks  of  object  code  would  appear
  1298.     contiguous.
  1299.  
  1300.     TASM - Table Driven Assembler Version 2.7                    Page 30
  1301.  
  1302.  
  1303.     LISTING FILE FORMAT
  1304.  
  1305.     Each line of source code generates one (or more) lines of output  in
  1306.     the listing file.  The fields of the output line are as follows:
  1307.  
  1308.             1.  Current  source  file  line  number  (4 decimal digits).
  1309.  
  1310.             2.  An optional '+' appears if this is  an  'INCLUDE'  file.
  1311.                     (One '+' for each level of INCLUDE invoked).
  1312.  
  1313.             3.  Current Instruction Pointer (4 hex digits).  An optional
  1314.                     '~' follows the Instruction Pointer if the  line  of
  1315.                     source  code  is  not  being assembled because of an
  1316.                     IFDEF, IFNDEF, or IF directive.
  1317.  
  1318.             4.  Resulting code/data generated from this source line (two
  1319.                     hex digits per byte, each byte separated by a space,
  1320.                     up to four bytes per line).
  1321.  
  1322.             5.  The  source  line  exactly  as  it appears in the source
  1323.                     file.
  1324.  
  1325.     If  paging  is  enabled (by either the '-p' option flag or the .PAGE
  1326.     directive) some additional fields will be inserted into the  listing
  1327.     file every 60 lines.  These fields are:
  1328.  
  1329.             1.  Top of Form (form feed).
  1330.             2.  Assembler identifier (e.g. "TASM 6502 Assembler").
  1331.             3.  Initial source file name.
  1332.             4.  Page number.
  1333.             5.  Title.
  1334.  
  1335.     For an example of the listing file format, see appendix A.
  1336.  
  1337.  
  1338.     TASM - Table Driven Assembler Version 2.7                    Page 31
  1339.  
  1340.  
  1341.     PROM PROGRAMMING
  1342.  
  1343.     A wide variety of PROM programming equipment is available  that  can
  1344.     use  object  code  in  one or more of the formats TASM supports.  We
  1345.     will not try to list all such  compatible  systems  here,  but  will
  1346.     mention one configuration that has worked well for us.
  1347.  
  1348.     We have used the Apparat "IBM PROM Blaster,  24 Pin" (available from
  1349.     Apparat Inc.,  4401 Tamarac Parkway,  Denver,  Colorado 80237, $129)
  1350.     for programming 24  pin  EPROMs  with  much  success.  The  software
  1351.     supplied  with  this  product  will accept a TASM object file in the
  1352.     binary  format  (-b  option  flag  on  TASM   command   line).   The
  1353.     combination   of  TASM  and  the  PROM  Blaster  make  for  a  truly
  1354.     inexpensive solution to the problem of generating  PROMed  code  for
  1355.     target microprocessor systems.  (STI is not affiliated or associated
  1356.     with Apparat in any way).
  1357.  
  1358.  
  1359.     Some additional notes about generating code to be put in PROMs:
  1360.  
  1361.             1.  It  is  often  desirable  to  have all bytes in the PROM
  1362.                     programmed even if not explicitly assigned  a  value
  1363.                     in the source code (e.g.  the bytes are skipped over
  1364.                     with a .ORG statement).  This can be accomplished by
  1365.                     using the -c (contiguous block) and  the  -f  (fill)
  1366.                     command  line option flags.  The -c will ensure that
  1367.                     every byte from the lowest byte assigned a value  to
  1368.                     the the highest byte assigned a value will be in the
  1369.                     object  file  with no gaps.  The -f flag will assign
  1370.                     the specified value to all bytes before the assembly
  1371.                     begins so that when the object file is written,  all
  1372.                     bytes  not  assigned a value in the source code will
  1373.                     have a known value.  As an  example,  the  following
  1374.                     command  line  will  generate  object  code  in  the
  1375.                     default Intel Hex format with all bytes not assigned
  1376.                     a value in the source set to EA (hex, 6502 NOP):
  1377.  
  1378.                     tasm -65 -c -fEA test.asm
  1379.  
  1380.             2.  To ensure that TASM generates object code to  cover  the
  1381.                     full  address  range of the target PROM,  put a .ORG
  1382.                     statement at the end of the source file set  to  the
  1383.                     last address desired.  For example, to generate code
  1384.                     to  be  put  in  a  2716  EPROM  (2 Kbytes) from hex
  1385.                     address $1000 to $17ff,  do something like  this  in
  1386.                     the source file:
  1387.  
  1388.     TASM - Table Driven Assembler Version 2.7                    Page 32
  1389.  
  1390.  
  1391.                              ;start of the file
  1392.                              .ORG    $1000
  1393.                              ;rest of the source code follows
  1394.  
  1395.                              <source code>
  1396.  
  1397.                              ;end of the source code
  1398.                              .ORG    $17ff
  1399.                              .BYTE   0
  1400.                              .END
  1401.  
  1402.                     Now,  to  invoke  TASM  to  generate the code in the
  1403.                     binary format with all unassigned bytes  set  to  00
  1404.                     (6502 BRK), do the following:
  1405.  
  1406.                     tasm -65 -b -f00 test.asm
  1407.  
  1408.                     Note that -b forces the -c option.
  1409.  
  1410.     TASM - Table Driven Assembler Version 2.7                    Page 33
  1411.  
  1412.  
  1413.     ERROR MESSAGES
  1414.  
  1415.  
  1416.     Error Message                           Description
  1417.     --------------------------------------------------------
  1418.     unrecognized directive..................A statement starting  with a
  1419.                                             '.'  or  '#'  has a mnemonic
  1420.                                             that is  not  defined  as  a
  1421.                                             directive.
  1422.  
  1423.     unrecognized  instruction...............A  statement  has  an opcode
  1424.                                             mnemonic   that    is    not
  1425.                                             defined.
  1426.  
  1427.     unrecognized argument...................A statement has  an  operand
  1428.                                             format that is not defined.
  1429.  
  1430.     label value misaligned..................The value of a label appears
  1431.                                             to have a different value on
  1432.                                             the  second pass then it was
  1433.                                             computed  to  have  on   the
  1434.                                             first    pass.    This    is
  1435.                                             generally due to  Zero  Page
  1436.                                             Addressing   mode   problems
  1437.                                             with  the  6502  version  of
  1438.                                             TASM.  Labels  that are used
  1439.                                             in operands  for  statements
  1440.                                             that   could  utilize   Zero
  1441.                                             Page addressing mode  should
  1442.                                             always   be  defined  before
  1443.                                             used as an operand.
  1444.  
  1445.     label table overflow....................To  many  labels  have  been
  1446.                                             encountered.
  1447.  
  1448.     No END directive before EOF.............The source file did not have
  1449.                                             an   END  directive  in  it.
  1450.                                             This is not fatal,  but  may
  1451.                                             cause  the  last object file
  1452.                                             record to be lost.
  1453.  
  1454.     No  files  specified....................TASM  was  invoked  with  no
  1455.                                             source file specified.
  1456.  
  1457.     TASM - Table Driven Assembler Version 2.7                    Page 34
  1458.  
  1459.  
  1460.     Unknown  option  flag...................TASM  was  invoked  with  an
  1461.                                             undefined option flag on the
  1462.                                             command line.
  1463.  
  1464.     Source file open error..................TASM was not  able  to  open
  1465.                                             the specified source file.
  1466.  
  1467.     List file open error....................TASM was not  able  to  open
  1468.                                             the specified list file.
  1469.  
  1470.     Object file open error..................TASM was not  able  to  open
  1471.                                             the specified object file.
  1472.  
  1473.     Unknown token...........................Unexpected  characters  were
  1474.                                             encountered while parsing an
  1475.                                             expression.
  1476.  
  1477.     maximum number of macros exceeded.......To  many  macros   (DEFINEs)
  1478.                                             have been encountered.
  1479.  
  1480.     macro buffer overflow...................The buffer from which  space
  1481.                                             is   allocated   for   macro
  1482.                                             definitions is exhausted.
  1483.  
  1484.     range of relative branch exceeded.......A branch instruction exceeds
  1485.                                             the  maximum   range   (6502
  1486.                                             Version).
  1487.  
  1488.     macro expansion too long................The  expansion  of  a  macro
  1489.                                             resulted  in  a  line  that
  1490.                                             exceeded the maximum length.
  1491.  
  1492.     TASM - Table Driven Assembler Version 2.7                    Page 35
  1493.  
  1494.  
  1495.     BUGS AND LIMITATIONS
  1496.  
  1497.     Limitations and Specifications
  1498.     ----------------------------------------------------------------
  1499.     Maximum number of labels                2000
  1500.     Maximum length of labels                13 characters
  1501.     Maximum address space                   64 Kbytes (65536 bytes)
  1502.     Maximum number of nested INCLUDES       4
  1503.     Maximum length of TITLE string          79 characters
  1504.     Maximum source line length              255 characters
  1505.     Maximum length after macro expansion    255 characters
  1506.     Maximum length of expressions           255 characters
  1507.     Maximum length of pathnames             79 characters
  1508.     Maximum length of command line          127 characters
  1509.  
  1510.     Maximum number of instructions          500
  1511.     Maximum number of macros                1000
  1512.     Maximum number of macro arguments       10
  1513.     Maximum length of macro argument        16 characters
  1514.     Heap size (for labels, macros, & buffers) 20000 bytes
  1515.     Memory requirements                     160K
  1516.  
  1517.     Bugs
  1518.  
  1519.     1.  The 8048 version of TASM does not check for use of memory beyond
  1520.             any  reasonable  bounds (e.g.  an 8048 has a maximum address
  1521.             space of 4 Kbytes but TASM will let  you  pretend  that  you
  1522.             have 64 Kbytes).
  1523.  
  1524.     2.  Expression evaluation has no operator precedence in effect which
  1525.             can  make  for  unexpected results if not explicitly grouped
  1526.             with parenthesis.
  1527.  
  1528.     3.  First  page  of  listing file will not show a user defined title
  1529.             (defined via TITLE directive).
  1530.  
  1531.     4.  TASM sometimes does not generate error messages  for  improperly
  1532.             formed expressions.
  1533.  
  1534.     5.  TASM expands macros in comments at the end of a line (but not in
  1535.             lines that are all comment).
  1536.  
  1537.     6.  TASM does not generate an error message when a EQU directive has
  1538.             an undefined label on the right hand side.
  1539.  
  1540.     TASM - Table Driven Assembler Version 2.7                    Page 36
  1541.  
  1542.  
  1543.     6502 INSTRUCTIONS AND ADDRESSING MODES
  1544.  
  1545.     The acceptable 6502 opcode mnemonics for TASM are as follows:
  1546.  
  1547.              ADC  AND  ASL  BCC  BCS  BEQ  BNE  BMI  BPL  BVC  BVS  BIT
  1548.              BRK  CLC  CLD  CLI  CLV  CMP  CPX  CPY  DEC  DEX  DEY  EOR
  1549.              INC  INX  INY  JMP  JSR  LDA  LDX  LDY  LSR  NOP  ORA  PHA
  1550.              PHP  PLA  PLP  ROL  ROR  RTI  RTS  SBC  SEC  SED  SEI  STA
  1551.              STX  STY  TAX  TAY  TSX  TXA  TXS  TYA
  1552.  
  1553.     TASM  also  supports the following instructions that are part of the
  1554.     Rockwell  R65C02  and  R65C00/21  microprocessor  instruction  sets.
  1555.     Those  that  are  marked  as  set A are applicable to the R65C02 and
  1556.     those marked as set B are  applicable  to  the  R65C00/21  (A+B  for
  1557.     both):
  1558.  
  1559.             Mnemonic        Description                Address Mode  Set
  1560.             ---------------------------------------------------------------
  1561.             ADC             Add with carry             (IND)         A
  1562.             AND             And memory with A          (IND)         A
  1563.             BIT             Test memory bits with A    ABS,X         A
  1564.             BIT             Test memory bits with A    ZP,X          A
  1565.             BIT             Test memory bits with A    IMM           A
  1566.             CMP             Compare memory with A      (IND)         A
  1567.             DEC             Decrement A                A             A
  1568.             EOR             Exclusive OR memory with A (IND)         A
  1569.             INC             Increment A                A             A
  1570.             JMP             Jump                       (ABS,X)       A
  1571.             LDA             Load A with memory         (IND)         A
  1572.             ORA             OR A with memory           (IND)         A
  1573.             SBC             Subtract memory form A     (IND)         A
  1574.             STA             Store A in memory          (IND)         A
  1575.             STZ             Store zero                 ABS           A
  1576.             STZ             Store zero                 ABS,X         A
  1577.             STZ             Store zero                 ZP            A
  1578.             STZ             Store zero                 ZP,X          A
  1579.             TRB             Test and reset memory bit  ABS           A
  1580.             TRB             Test and reset memory bit  ZP            A
  1581.             TSB             Test and set memory bit    ABS           A
  1582.             TSB             Test and set memory bit    ZP            A
  1583.  
  1584.             BRA             Branch Always              REL           A+B
  1585.  
  1586.             BBR0            Branch on Bit 0 Reset      ZP,REL        A+B
  1587.             BBR1            Branch on Bit 1 Reset      ZP,REL        A+B
  1588.             BBR2            Branch on Bit 2 Reset      ZP,REL        A+B
  1589.  
  1590.     TASM - Table Driven Assembler Version 2.7                    Page 37
  1591.  
  1592.             BBR3            Branch on Bit 3 Reset      ZP,REL        A+B
  1593.             BBR4            Branch on Bit 4 Reset      ZP,REL        A+B
  1594.             BBR5            Branch on Bit 5 Reset      ZP,REL        A+B
  1595.             BBR6            Branch on Bit 6 Reset      ZP,REL        A+B
  1596.             BBR7            Branch on Bit 7 Reset      ZP,REL        A+B
  1597.  
  1598.             BBS0            Branch on Bit 0 Set        ZP,REL        A+B
  1599.             BBS1            Branch on Bit 1 Set        ZP,REL        A+B
  1600.             BBS2            Branch on Bit 2 Set        ZP,REL        A+B
  1601.             BBS3            Branch on Bit 3 Set        ZP,REL        A+B
  1602.             BBS4            Branch on Bit 4 Set        ZP,REL        A+B
  1603.             BBS5            Branch on Bit 5 Set        ZP,REL        A+B
  1604.             BBS6            Branch on Bit 6 Set        ZP,REL        A+B
  1605.             BBS7            Branch on Bit 7 Set        ZP,REL        A+B
  1606.  
  1607.             MUL             Multiply                   Implied       B
  1608.  
  1609.             PHX             Push Index X               Implied       A+B
  1610.             PHY             Push Index Y               Implied       A+B
  1611.             PLX             Pull Index X               Implied       A+B
  1612.             PLY             Pull Index Y               Implied       A+B
  1613.  
  1614.             RMB0            Reset Memory Bit 0         ZP            A+B
  1615.             RMB1            Reset Memory Bit 1         ZP            A+B
  1616.             RMB2            Reset Memory Bit 2         ZP            A+B
  1617.             RMB3            Reset Memory Bit 3         ZP            A+B
  1618.             RMB4            Reset Memory Bit 4         ZP            A+B
  1619.             RMB5            Reset Memory Bit 5         ZP            A+B
  1620.             RMB6            Reset Memory Bit 6         ZP            A+B
  1621.             RMB7            Reset Memory Bit 7         ZP            A+B
  1622.  
  1623.             SMB0            Set   Memory Bit 0         ZP            A+B
  1624.             SMB1            Set   Memory Bit 1         ZP            A+B
  1625.             SMB2            Set   Memory Bit 2         ZP            A+B
  1626.             SMB3            Set   Memory Bit 3         ZP            A+B
  1627.             SMB4            Set   Memory Bit 4         ZP            A+B
  1628.             SMB5            Set   Memory Bit 5         ZP            A+B
  1629.             SMB6            Set   Memory Bit 6         ZP            A+B
  1630.             SMB7            Set   Memory Bit 7         ZP            A+B
  1631.  
  1632.     Note that correct assembly of these extended  instructions  has  not
  1633.     been tested on a target system.
  1634.  
  1635.     TASM - Table Driven Assembler Version 2.7                    Page 38
  1636.  
  1637.  
  1638.     Addressing  modes  are denoted as follows:
  1639.  
  1640.             ABS               Absolute
  1641.             ZP                Zero Page
  1642.             ABS,X             Absolute X
  1643.             ZP,X              Zero Page X
  1644.             ABS,Y             Absolute Y
  1645.             ZP,Y              Zero Page Y
  1646.             A                 Accumulator
  1647.             (IND,X)           Indirect X
  1648.             (IND),Y           Indirect Y
  1649.             (IND)             Indirect
  1650.             #IMM              Immediate
  1651.             REL               Relative (Branch instructions only)
  1652.             ZP,REL            Zero Page, Relative
  1653.             Implied           Implied
  1654.  
  1655.     Note  that Zero Page addressing can not be explicitly requested.  It
  1656.     is used if the value of the operand is  representable  in  a  single
  1657.     byte for the applicable statements.
  1658.  
  1659.     The '-x' command line option can be  used  to  enable  the  extended
  1660.     instructions.  A  '-x'  with  no  digit  following  will  enable the
  1661.     standard set plus both extended sets.  The 6502 version of TASM uses
  1662.     three bits in the instruction class  mask  to  determine  whether  a
  1663.     given  instruction  is enabled or not.  Bit 0 enables the basic set,
  1664.     bit 1 enables set A (R65C02) and bit 2 enables  set  B  (R65C00/21).
  1665.     The following table shows various options:
  1666.  
  1667.             Class Mask        Enabled Instructions
  1668.                             BASIC   R65C02  R65C00/21
  1669.             --------------------------------------------
  1670.             1               yes     no      no
  1671.             2               no      yes     no
  1672.             3               yes     yes     no
  1673.             4               no      no      yes
  1674.             5               yes     no      yes
  1675.             6               no      yes     yes
  1676.             7               yes     yes     yes
  1677.  
  1678.     Thus,  to enable the basic set plus the R65C02 instructions,  invoke
  1679.     the '-x3' command line option.
  1680.  
  1681.     See manufacturer's data for  a  more  complete  description  of  the
  1682.     meaning of the mnemonics and addressing modes.
  1683.  
  1684.     TASM - Table Driven Assembler Version 2.7                    Page 39
  1685.  
  1686.  
  1687.     8048 INSTRUCTIONS AND ADDRESSING MODES
  1688.  
  1689.     The following list shows the acceptable opcode mnemonics  and  their
  1690.     corresponding  operand  formats for the 8048 version of TASM.  Where
  1691.     'Rn' is seen,  R0 through R7  may  be  substituted.  Other  symbolic
  1692.     fields are as follows:
  1693.  
  1694.             SYMBOLIC            DESCRIPTION
  1695.             -----------------------------------------------
  1696.             <addr8>             Absolute address (8 bits)
  1697.             <addr11>            Absolute address (11 bits)
  1698.             <immed>             Immediate data
  1699.  
  1700.     Any valid TASM expression can appear in the  place  of  any  of  the
  1701.     above symbolics.
  1702.  
  1703.     The lines that are marked with an (8041),  (8022),  or (8021) on the
  1704.     far  right are extended instructions that are available only if a -x
  1705.     option has  been  invoked  on  the  command  line.  The  classes  of
  1706.     instructions  (and their bit assignment in the class mask) are shown
  1707.     below:
  1708.  
  1709.             BIT     PROCESSOR
  1710.             -------------------------------
  1711.             0       8X48, 8035, 8039, 8049
  1712.             1       8X41A
  1713.             2       8022
  1714.             3       8021
  1715.  
  1716.     Thus, to enable the basic 8048 set plus the 8022 set, a -x5 could be
  1717.     used on the command line.
  1718.  
  1719.     Note that some of the base instructions should be disabled  for  the
  1720.     8041, 8022, and 8021, but are not.
  1721.  
  1722.     OPCODE  OPERANDS        DESCRIPTION
  1723.     -------------------------------------------------------------------
  1724.     ADD     A,Rn            Add Register to Acc
  1725.     ADD     A,@R0           Add Indirect RAM to Acc
  1726.     ADD     A,@R1           Add Indirect RAM to Acc
  1727.     ADD     A,#<immed>      Add Immediate data to Acc
  1728.  
  1729.     ADDC    A,Rn            Add Register to Acc with carry
  1730.     ADDC    A,@R0           Add Indirect RAM to Acc with carry
  1731.     ADDC    A,@R1           Add Indirect RAM to Acc with carry
  1732.     ADDC    A,#<immed>      Add Immediate data to Acc with carry
  1733.  
  1734.     TASM - Table Driven Assembler Version 2.7                    Page 40
  1735.  
  1736.  
  1737.     ANL     A,Rn            AND Register to Acc
  1738.     ANL     A,@R0           AND Indirect RAM to Acc
  1739.     ANL     A,@R1           AND Indirect RAM to Acc
  1740.     ANL     A,#<immed>      AND Immediate data to Acc
  1741.     ANL     BUS,#<immed>    AND Immediate data to BUS
  1742.     ANL     P1,#<immed>     AND Immediate data to port P1
  1743.     ANL     P2,#<immed>     AND Immediate data to port P2
  1744.  
  1745.     ANLD    P4,A            AND Acc to Expander port P4
  1746.     ANLD    P5,A            AND Acc to Expander port P5
  1747.     ANLD    P6,A            AND Acc to Expander port P6
  1748.     ANLD    P7,A            AND Acc to Expander port P7
  1749.  
  1750.     CALL    <addr11>        Call subroutine
  1751.  
  1752.     CLR     A               Clear Acc
  1753.     CLR     C               Clear Carry
  1754.     CLR     F0              Clear Flag 0
  1755.     CLR     F1              Clear Flag 1
  1756.  
  1757.     CPL     A               Complement Acc
  1758.     CPL     C               Complement Carry
  1759.     CPL     F0              Complement Flag F0
  1760.     CPL     F1              Complement Flag F1
  1761.  
  1762.     DA      A               Decimal adjust Acc
  1763.  
  1764.     DEC     A               Decrement Acc
  1765.     DEC     Rn              Decrement Register
  1766.  
  1767.     DIS     I               Disable Interrupts
  1768.     DIS     TCNTI           Disable Timer/Counter Interrupt
  1769.  
  1770.     DJNZ    Rn,<addr8>      Decrement Register and Jump if nonzero
  1771.  
  1772.     EN      DMA             Enable DMA                           (8041)
  1773.     EN      FLAGS           Enable Flags                         (8041)
  1774.     EN      I               Enable External Interrupt
  1775.     EN      TCNTI           Enable Timer/Counter Interrupt
  1776.     ENT0    CLK             Enable Clock Output
  1777.  
  1778.     IN      A,DBB           Input Data Bus to Acc                (8041)
  1779.     IN      A,P0            Input Port 0 to Acc                  (8021)
  1780.     IN      A,P1            Input Port 1 to Acc
  1781.     IN      A,P2            Input Port 2 to Acc
  1782.  
  1783.  
  1784.     TASM - Table Driven Assembler Version 2.7                    Page 41
  1785.  
  1786.     INC     A               Increment Acc
  1787.     INC     Rn              Increment Register
  1788.     INC     @R0             Increment Indirect RAM
  1789.     INC     @R1             Increment Indirect RAM
  1790.  
  1791.     INS     A,BUS           Strobed Input of Bus to Acc
  1792.  
  1793.     JB0     <addr8>         Jump if Acc bit 0 is set
  1794.     JB1     <addr8>         Jump if Acc bit 1 is set
  1795.     JB2     <addr8>         Jump if Acc bit 2 is set
  1796.     JB3     <addr8>         Jump if Acc bit 3 is set
  1797.     JB4     <addr8>         Jump if Acc bit 4 is set
  1798.     JB5     <addr8>         Jump if Acc bit 5 is set
  1799.     JB6     <addr8>         Jump if Acc bit 6 is set
  1800.     JB7     <addr8>         Jump if Acc bit 7 is set
  1801.     JMP     <addr11>        Jump
  1802.     JC      <addr8>         Jump if Carry is set
  1803.     JF0     <addr8>         Jump if Flag F0 is set
  1804.     JF1     <addr8>         Jump if Flag F1 is set
  1805.     JNC     <addr8>         Jump if Carry is clear
  1806.     JNI     <addr8>         Jump if Interrupt input is clear
  1807.     JNIBF   <addr8>         Jump if IBF is clear                 (8041)
  1808.     JNT0    <addr8>         Jump if T0 is clear
  1809.     JNT1    <addr8>         Jump if T1 is clear
  1810.     JNZ     <addr8>         Jump if Acc is not zero
  1811.     JOBF    <addr8>         Jump if OBF is set                   (8041)
  1812.     JTF     <addr8>         Jump if Timer Flag is set
  1813.     JT0     <addr8>         Jump if T0 pin is high
  1814.     JT1     <addr8>         Jump if T1 pin is high
  1815.     JZ      <addr8>         Jump if Acc is zero
  1816.     JMPP    @A              Jump Indirect (current page)
  1817.  
  1818.     MOV     A,PSW           Move PSW to Acc
  1819.     MOV     A,Rn            Move Register to Acc
  1820.     MOV     A,T             Move Timer/Counter to Acc
  1821.     MOV     A,@R0           Move Indirect RAM to Acc
  1822.     MOV     A,@R1           Move Indirect RAM to Acc
  1823.     MOV     A,#<immed>      Move Immediate data to Acc
  1824.     MOV     PSW,A           Move Acc to PSW
  1825.     MOV     Rn,A            Move Acc to Register
  1826.     MOV     Rn,#<immed>     Move Immediate data to Register
  1827.     MOV     STS,A           Move Acc to STS                      (8041)
  1828.     MOV     T,A             Move Acc to Timer/Counter
  1829.     MOV     @R0,A           Move Acc to Indirect RAM
  1830.     MOV     @R1,A           Move Acc to Indirect RAM
  1831.     MOV     @R0,#<immed>    Move Immediate data to Indirect RAM
  1832.     MOV     @R1,#<immed>    Move Immediate data to Indirect RAM
  1833.  
  1834.     TASM - Table Driven Assembler Version 2.7                    Page 42
  1835.  
  1836.  
  1837.     MOVD    A,P4            Move half-byte Port 4 to Acc (lower nibble)
  1838.     MOVD    A,P5            Move half-byte Port 5 to Acc (lower nibble)
  1839.     MOVD    A,P6            Move half-byte Port 6 to Acc (lower nibble)
  1840.     MOVD    A,P7            Move half-byte Port 7 to Acc (lower nibble)
  1841.     MOVD    P4,A            Move lower nibble of Acc to Port 4
  1842.     MOVD    P5,A            Move lower nibble of Acc to Port 5
  1843.     MOVD    P6,A            Move lower nibble of Acc to Port 6
  1844.     MOVD    P7,A            Move lower nibble of Acc to Port 7
  1845.  
  1846.     MOVP    A,@A            Move Indirect Program data to Acc
  1847.     MOVP3   A,@A            Move Indirect Program data to Acc (page 3)
  1848.  
  1849.     MOVX    A,@R0           Move Indirect External RAM to Acc
  1850.     MOVX    A,@R1           Move Indirect External RAM to Acc
  1851.     MOVX    @R0,A           Move Acc to Indirect External RAM
  1852.     MOVX    @R1,A           Move Acc to Indirect External RAM
  1853.  
  1854.     NOP                     No operation
  1855.  
  1856.     ORL     A,Rn            OR Register to Acc
  1857.     ORL     A,@R0           OR Indirect RAM to Acc
  1858.     ORL     A,@R1           OR Indirect RAM to Acc
  1859.     ORL     A,#<immed>      OR Immediate data to Acc
  1860.     ORL     BUS,#<immed>    OR Immediate data to BUS
  1861.     ORL     P1,#<immed>     OR Immediate data to port P1
  1862.     ORL     P2,#<immed>     OR Immediate data to port P2
  1863.  
  1864.     ORLD    P4,A            OR lower nibble of Acc with P4
  1865.     ORLD    P5,A            OR lower nibble of Acc with P5
  1866.     ORLD    P6,A            OR lower nibble of Acc with P6
  1867.     ORLD    P7,A            OR lower nibble of Acc with P7
  1868.  
  1869.     OUTL    BUS,A           Output Acc to Bus
  1870.     OUT     DBB,A           Output Acc to DBB                    (8041)
  1871.     OUTL    P0,A            Output Acc to Port P0                (8021)
  1872.     OUTL    P1,A            Output Acc to Port P1
  1873.     OUTL    P2,A            Output Acc to Port P2
  1874.  
  1875.     RAD                     Move A/D Converter to Acc            (8022)
  1876.  
  1877.     RET                     Return from subroutine
  1878.     RETI                    Return from Interrupt w/o PSW restore(8022)
  1879.     RETR                    Return from Interrupt w/  PSW restore
  1880.  
  1881.     RL      A               Rotate Acc Left
  1882.     RLC     A               Rotate Acc Left through Carry
  1883.  
  1884.     TASM - Table Driven Assembler Version 2.7                    Page 43
  1885.  
  1886.     RR      A               Rotate Acc Right
  1887.     RRC     A               Rotate Acc Right through Carry
  1888.  
  1889.     SEL     AN0             Select Analog Input 0                (8022)
  1890.     SEL     AN1             Select Analog Input 1                (8022)
  1891.     SEL     MB0             Select Memory Bank 0
  1892.     SEL     MB1             Select Memory Bank 1
  1893.     SEL     RB0             Select Register Bank 0
  1894.     SEL     RB1             Select Register Bank 1
  1895.  
  1896.     STOP    TCNT            Stop Timer/Counter
  1897.     STRT    CNT             Start Counter
  1898.     STRT    T               Start Timer
  1899.  
  1900.     SWAP    A               Swap nibbles of Acc
  1901.  
  1902.     XCH     A,Rn            Exchange Register with Acc
  1903.     XCH     A,@R0           Exchange Indirect RAM with Acc
  1904.     XCH     A,@R1           Exchange Indirect RAM with Acc
  1905.  
  1906.     XCHD    A,@R0           Exchange lower nibble of Indirect RAM w/ Acc
  1907.     XCHD    A,@R1           Exchange lower nibble of Indirect RAM w/ Acc
  1908.  
  1909.     XRL     A,Rn            Exclusive OR Register to Acc
  1910.     XRL     A,@R0           Exclusive OR Indirect RAM to Acc
  1911.     XRL     A,@R1           Exclusive OR Indirect RAM to Acc
  1912.     XRL     A,#<immed>      Exclusive OR Immediate data to Acc
  1913.  
  1914.  
  1915.     See manufacturer's data for  a  more  complete  description  of  the
  1916.     meaning of the mnemonics and addressing modes.
  1917.  
  1918.     TASM - Table Driven Assembler Version 2.7                    Page 44
  1919.  
  1920.  
  1921.     8051 INSTRUCTIONS AND ADDRESSING MODES
  1922.  
  1923.     The following list shows the acceptable opcode mnemonics  and  their
  1924.     corresponding  operand  formats for the 8051 version of TASM.  Where
  1925.     'Rn' is seen,  R0 through R7  may  be  substituted.  Other  symbolic
  1926.     fields are as follows:
  1927.  
  1928.             SYMBOLIC            DESCRIPTION
  1929.             -----------------------------------------------
  1930.             <addr11>            Absolute address (11 bits)
  1931.             <addr16>            Absolute address (16 bits)
  1932.             <bit>               Bit address
  1933.             <immed>             Immediate data
  1934.             <direct>            Direct RAM address
  1935.             <rel>               Relative address
  1936.  
  1937.     Any valid TASM expression can appear in the  place  of  any  of  the
  1938.     above symbolics.
  1939.  
  1940.     OPCODE  OPERAND             DESCRIPTION
  1941.     --------------------------------------------------------------------
  1942.     ACALL   <addr11>            Absolute Call
  1943.  
  1944.     ADD     A,Rn                Add Register to Acc
  1945.     ADD     A,@R0               Add Indirect RAM to Acc
  1946.     ADD     A,@R1               Add Indirect RAM to Acc
  1947.     ADD     A,#<immed>          Add Immediate data to Acc
  1948.     ADD     A,<direct>          Add Direct RAM to Acc
  1949.  
  1950.     ADDC    A,Rn                Add Register to Acc with carry
  1951.     ADDC    A,@R0               Add Indirect RAM to Acc with carry
  1952.     ADDC    A,@R1               Add Indirect RAM to Acc with carry
  1953.     ADDC    A,#<immed>          Add Immediate data to Acc with carry
  1954.     ADDC    A,<direct>          Add Direct RAM to Acc with carry
  1955.  
  1956.     AJMP    <addr11>            Absolute Jump
  1957.  
  1958.     ANL     A,Rn                AND Register and Acc
  1959.     ANL     A,@R0               AND Indirect RAM and Acc
  1960.     ANL     A,@R1               AND Indirect RAM and Acc
  1961.     ANL     A,#<immed>          AND Immediate data and Acc
  1962.     ANL     A,<direct>          AND Direct RAM and Acc
  1963.     ANL     C,/<direct>         AND Complement of direct bit to Carry
  1964.     ANL     C,<direct>          AND direct bit to Carry
  1965.     ANL     <direct>,A          AND Acc to direct RAM
  1966.     ANL     <direct>,#<immed>   AND Immediate data and direct RAM
  1967.  
  1968.     TASM - Table Driven Assembler Version 2.7                    Page 45
  1969.  
  1970.  
  1971.     CJNE    A,#<immed>,<rel>    Compare Immediate to Acc   and JNE
  1972.     CJNE    A,<direct>,<rel>    Compare direct RAM to Acc and JNE
  1973.     CJNE    Rn,#<immed>,<rel>   Compare Immediate to Register and JNE
  1974.     CJNE    @R0,#<immed>,<rel>  Compare Immediate to Indirect RAM and JNE
  1975.     CJNE    @R1,#<immed>,<rel>  Compare Immediate to Indirect RAM and JNE
  1976.  
  1977.     CLR     A                   Clear Accumulator
  1978.     CLR     C                   Clear Carry
  1979.     CLR     <direct>            Clear Direct RAM
  1980.  
  1981.     CPL     A                   Complement Accumulator
  1982.     CPL     C                   Complement Carry
  1983.     CPL     <direct>            Complement Direct RAM
  1984.  
  1985.     DA      A                   Decimal Adjust Accumulator
  1986.  
  1987.     DEC     A                   Decrement Acc
  1988.     DEC     Rn                  Decrement Register
  1989.     DEC     @R0                 Decrement Indirect RAM
  1990.     DEC     @R1                 Decrement Indirect RAM
  1991.     DEC     <direct>            Decrement Direct RAM
  1992.  
  1993.     DIV     AB                  Divide Acc by B
  1994.  
  1995.     DJNZ    Rn,<rel>            Decrement Register and JNZ
  1996.     DJNZ    <direct>,<rel>      Decrement Direct RAM and JNZ
  1997.  
  1998.     INC     A                   Increment Acc
  1999.     INC     Rn                  Increment Register
  2000.     INC     @R0                 Increment Indirect RAM
  2001.     INC     @R1                 Increment Indirect RAM
  2002.     INC     DPTR                Increment Data Pointer
  2003.     INC     <direct>            Increment Direct RAM
  2004.  
  2005.     JB      <bit>,<rel>         Jump if Bit is set
  2006.     JBC     <bit>,<rel>         Jump if Bit is set & clear Bit
  2007.     JC      <rel>               Jump if Carry is set
  2008.     JMP     @A+DPTR             Jump indirect relative to Data Pointer
  2009.     JNB     <bit>,<rel>         Jump if Bit is clear
  2010.     JNC     <rel>               Jump if Carry is clear
  2011.     JNZ     <rel>               Jump if Acc is not zero
  2012.     JZ      <rel>               Jump if Acc is zero
  2013.  
  2014.     LCALL   <addr16>            Long Subroutine Call
  2015.     LJMP    <addr16>            Long Jump
  2016.  
  2017.  
  2018.     TASM - Table Driven Assembler Version 2.7                    Page 46
  2019.  
  2020.     MOV     A,Rn                Move Register to Acc
  2021.     MOV     A,@R0               Move Indirect RAM to Acc
  2022.     MOV     A,@R1               Move Indirect RAM to Acc
  2023.     MOV     A,#<immed>          Move Immediate data to Acc
  2024.     MOV     A,<direct>          Move direct RAM to Acc
  2025.     MOV     C,<bit>             Move bit to Acc
  2026.     MOV     DPTR,#<immed>       Move immediate data to Data Pointer
  2027.     MOV     Rn,A                Move Acc to Register
  2028.     MOV     Rn,#<immed>         Move Immediate data to Register
  2029.     MOV     Rn,<direct>         Move Direct RAM to Register
  2030.     MOV     @R0,A               Move Acc to Indirect RAM
  2031.     MOV     @R1,A               Move Acc to Indirect RAM
  2032.     MOV     @R0,#<immed>        Move Immediate data to Indirect RAM
  2033.     MOV     @R1,#<immed>        Move Immediate data to Indirect RAM
  2034.     MOV     @R0,<direct>        Move Direct RAM to Indirect RAM
  2035.     MOV     @R1,<direct>        Move Direct RAM to Indirect RAM
  2036.     MOV     <direct>,A          Move Acc to Direct RAM
  2037.     MOV     <bit>,C             Move Carry to Bit
  2038.     MOV     <direct>,Rn         Move Register to Direct RAM
  2039.     MOV     <direct>,@R0        Move Indirect RAM to Direct RAM
  2040.     MOV     <direct>,@R1        Move Indirect RAM to Direct RAM
  2041.     MOV     <direct>,#<immed>   Move Immediate data to Direct RAM
  2042.     MOV     <direct>,<direct>   Move Direct RAM to Direct RAM
  2043.     MOVC    A,@A+DPTR           Move code byte relative to DPTR to Acc
  2044.     MOVC    A,@A+PC             Move code byte relative to PC to Acc
  2045.  
  2046.     MOVX    A,@R0               Move external RAM to Acc
  2047.     MOVX    A,@R1               Move external RAM to Acc
  2048.     MOVX    A,@DPTR             Move external RAM to Acc (16 bit addr)
  2049.     MOVX    @R0,A               Move Acc to external RAM
  2050.     MOVX    @R1,A               Move Acc to external RAM
  2051.     MOVX    @DPTR,A             Move Acc to external RAM (16 bit addr)
  2052.  
  2053.     MUL     AB                  Multiply Acc by B
  2054.  
  2055.     NOP                         No operation
  2056.  
  2057.     ORL     A,Rn                OR Register and Acc
  2058.     ORL     A,@R0               OR Indirect RAM and Acc
  2059.     ORL     A,@R1               OR Indirect RAM and Acc
  2060.     ORL     A,#<immed>          OR Immediate data and Acc
  2061.     ORL     A,<direct>          OR Direct RAM and Acc
  2062.     ORL     C,/<direct>         OR Complement of direct bit to Carry
  2063.     ORL     C,<direct>          OR direct bit to Carry
  2064.     ORL     <direct>,A          OR Acc to direct RAM
  2065.     ORL     <direct>,#<immed>   OR Immediate data and direct RAM
  2066.  
  2067.  
  2068.     TASM - Table Driven Assembler Version 2.7                    Page 47
  2069.  
  2070.     POP     <direct>            Pop  from Stack and put in Direct RAM
  2071.     PUSH    <direct>            Push from Direct RAM to Stack
  2072.  
  2073.     RET                         Return from subroutine
  2074.     RETI                        Return from Interrupt
  2075.  
  2076.     RL      A                   Rotate Acc left
  2077.     RLC     A                   Rotate Acc left through Carry
  2078.     RR      A                   Rotate Acc right
  2079.     RRC     A                   Rotate Acc right through Carry
  2080.  
  2081.     SETB    C                   Set the Carry Bit
  2082.     SETB    <bit>               Set Direct Bit
  2083.  
  2084.     SJMP    <rel>               Short jump
  2085.  
  2086.     SUBB    A,Rn                Subtract Register from Acc with Borrow
  2087.     SUBB    A,@R0               Subtract Indirect RAM from Acc w/ Borrow
  2088.     SUBB    A,@R1               Subtract Indirect RAM from Acc w/ Borrow
  2089.     SUBB    A,#<immed>          Subtract Immediate data from Acc w/ Borrow
  2090.     SUBB    A,<direct>          Subtract Direct RAM from Acc w/ Borrow
  2091.  
  2092.     SWAP    A                   Swap nibbles of Acc
  2093.  
  2094.     XCH     A,Rn                Exchange Acc with Register
  2095.     XCH     A,@R0               Exchange Acc with Indirect RAM
  2096.     XCH     A,@R1               Exchange Acc with Indirect RAM
  2097.     XCH     A,<direct>          Exchange Acc with Direct RAM
  2098.  
  2099.     XCHD    A,@R0               Exchange Digit in Acc with Indirect RAM
  2100.     XCHD    A,@R1               Exchange Digit in Acc with Indirect RAM
  2101.  
  2102.     XRL     A,Rn                Exclusive OR Register and Acc
  2103.     XRL     A,@R0               Exclusive OR Indirect RAM and Acc
  2104.     XRL     A,@R1               Exclusive OR Indirect RAM and Acc
  2105.     XRL     A,#<immed>          Exclusive OR Immediate data and Acc
  2106.     XRL     A,<direct>          Exclusive OR Direct RAM and Acc
  2107.     XRL     <direct>,A          Exclusive OR Acc to direct RAM
  2108.     XRL     <direct>,#<immed>   Exclusive OR Immediate data and direct RAM
  2109.  
  2110.     Note  that  the above tables do not automatically define the various
  2111.     mnemonics that may be  used  for  addressing  the  special  function
  2112.     registers  of  the  8051.  The  user  may  wish  to set up a file of
  2113.     equates (EQU's) that can be included in the  source  file  for  this
  2114.     purpose.  The following illustrates some of the appropriate equates:
  2115.  
  2116.  
  2117.  
  2118.     TASM - Table Driven Assembler Version 2.7                    Page 48
  2119.  
  2120.     P0      .equ    080H    ;Port 0
  2121.     SP      .equ    081H    ;Stack pointer
  2122.     DPL     .equ    082H
  2123.     DPH     .equ    083H
  2124.     PCON    .equ    087H
  2125.     TCON    .equ    088H
  2126.     TMOD    .equ    089H
  2127.     TL0     .equ    08AH
  2128.     TL1     .equ    08BH
  2129.     TH0     .equ    08CH
  2130.     TH1     .equ    08DH
  2131.     P1      .equ    090H    ;Port 1
  2132.     SCON    .equ    098H
  2133.     SBUF    .equ    099H
  2134.     P2      .equ    0A0H    ;Port 2
  2135.     IEC     .equ    0A8H
  2136.     P3      .equ    0B0H    ;Port 3
  2137.     IPC     .equ    0B8H
  2138.     PSW     .equ    0D0H
  2139.     ACC     .equ    0E0H    ;Accumulator
  2140.     B       .equ    0F0H    ;Secondary Accumulator
  2141.     ;Now some bit addresses
  2142.     P0.0    .equ    080H    ;Port 0 bit 0
  2143.     P0.1    .equ    081H    ;Port 0 bit 1
  2144.     P0.2    .equ    082H    ;Port 0 bit 2
  2145.     P0.3    .equ    083H    ;Port 0 bit 3
  2146.     P0.4    .equ    080H    ;Port 0 bit 4
  2147.     P0.5    .equ    081H    ;Port 0 bit 5
  2148.     P0.6    .equ    082H    ;Port 0 bit 6
  2149.     P0.7    .equ    083H    ;Port 0 bit 7
  2150.     ACC.0   .equ    0E0H    ;Acc bit 0
  2151.     ACC.1   .equ    0E1H    ;Acc bit 1
  2152.     ACC.2   .equ    0E2H    ;Acc bit 2
  2153.     ACC.3   .equ    0E3H    ;Acc bit 3
  2154.     ACC.4   .equ    0E4H    ;Acc bit 4
  2155.     ACC.5   .equ    0E5H    ;Acc bit 5
  2156.     ACC.6   .equ    0E6H    ;Acc bit 6
  2157.     ACC.7   .equ    0E7H    ;Acc bit 7
  2158.  
  2159.     See the manufacturer's data sheets for more information.
  2160.  
  2161.     TASM - Table Driven Assembler Version 2.7                    Page 49
  2162.  
  2163.  
  2164.     8085 INSTRUCTIONS AND ADDRESSING MODES
  2165.  
  2166.     The following list shows the acceptable opcode mnemonics  and  their
  2167.     corresponding  operand  formats for the 8085  version of TASM.   The
  2168.     following symbols are used in the table:
  2169.  
  2170.             SYMBOLIC            DESCRIPTION
  2171.             -----------------------------------------------
  2172.             <addr>              Absolute address (16 bits)
  2173.             <data>              Immediate data (8 bits)
  2174.             <data16>            Immediate data (16 bits)
  2175.             <reg>               Register (A,B,C,D,E,H,L)
  2176.             <rp>                Register pair (B,D,H,SP)
  2177.             <port>              Port address (0-255)
  2178.             <int>               Interrupt level (0 - 7)
  2179.  
  2180.     Any valid TASM expression can appear in the  place  of  any  of  the
  2181.     above symbolics except <reg>, <rp> and <int>.
  2182.  
  2183.     OPCODE  OPERAND        DESCRIPTION
  2184.     --------------------------------------------------------------------
  2185.     ACI      <data>         Add immediate to A with carry
  2186.     ADC      <reg>          Add <reg> to A with carry
  2187.     ADC      M              Add indirect memory (HL) with carry
  2188.     ADD      <reg>          Add <reg> to A
  2189.     ADD      M              Add indirect memory (HL) to A
  2190.     ADI      <data>         Add immediate to A
  2191.  
  2192.     ANA      <reg>          And register with A
  2193.     ANA      M              And indirect memory (HL) to A
  2194.     ANI      <data>         And immediate to A
  2195.  
  2196.     CALL     <addr>         Call subroutine at <addr>
  2197.     CC       <addr>         Call subroutine if carry set
  2198.     CNC      <addr>         Call subroutine if carry clear
  2199.     CZ       <addr>         Call subroutine if zero
  2200.     CNZ      <addr>         Call subroutine if non zero
  2201.     CP       <addr>         Call subroutine if positive
  2202.     CM       <addr>         Call subroutine if negative
  2203.     CPE      <addr>         Call subroutine if even parity
  2204.     CPO      <addr>         Call subroutine if odd  parity
  2205.     CMA                     Complement A
  2206.     CMC                     Complemennt carry
  2207.     CMP      <reg>          Compare register with A
  2208.     CMP      M              Compare indirect memory (HL) with A
  2209.     CPI      <data>         Compare immediate data with A
  2210.  
  2211.     TASM - Table Driven Assembler Version 2.7                    Page 50
  2212.  
  2213.  
  2214.     DAA                     Decimal adjust A
  2215.     DAD      <rp>           Add register pair to HL
  2216.     DCR      <reg>          Decrement register
  2217.     DCR      M              Decrement indirect memory (HL)
  2218.     DCX      <rp>           Decrement register pair
  2219.  
  2220.     DI                      Disable interrupts
  2221.     EI                      Enable interrupts
  2222.     HLT                     Halt
  2223.  
  2224.     IN       <port>         Input on port
  2225.     INR      <reg>          Increment register
  2226.     INR      M              Increment indirect memory (HL)
  2227.     INX      <rp>           Increment register pair
  2228.  
  2229.     JMP      <addr>         Jump
  2230.     JC       <addr>         Jump if carry set
  2231.     JNC      <addr>         Jump if carry clear
  2232.     JZ       <addr>         Jump if zero
  2233.     JNZ      <addr>         Jump if not zero
  2234.     JM       <addr>         Jump if minus
  2235.     JP       <addr>         Jump if plus
  2236.     JPE      <addr>         Jump if parity even
  2237.     JPO      <addr>         Jump if parity odd
  2238.  
  2239.     LDA      <addr>         Load A direct from memory
  2240.     LDAX     B              Load A indirect from memory using BC
  2241.     LDAX     D              Load A indirect from memory using DE
  2242.     LHLD     <addr>         Load HL direct from memory
  2243.     LXI      <rp>,<data16>  Load register pair with immediate data
  2244.  
  2245.     MOV      <reg>,<reg>    Move register to register
  2246.     MOV      <reg>,M        Move indirect memory (HL) to register
  2247.     MVI      <reg>,<data>   Move immediate data to register
  2248.  
  2249.     NOP                     No operation
  2250.  
  2251.     ORA      <reg>          Or register with A
  2252.     ORA      M              Or indirect memory (HL) with A
  2253.     ORI      <data>         Or immediate data to A
  2254.     OUT      <port>         Ouput to port
  2255.  
  2256.     PCHL                    Jump to instruction at (HL)
  2257.     POP      <rp>           Pop  register pair (excluding SP) from stack
  2258.     PUSH     <rp>           Push register pair (excluding SP) onto stack
  2259.     POP      PSW            Pop  PSW from stack
  2260.  
  2261.     TASM - Table Driven Assembler Version 2.7                    Page 51
  2262.  
  2263.     PUSH     PSW            Pop  PSW onto stack
  2264.  
  2265.     RAL                     Rotate A left  with carry
  2266.     RAR                     Rotate A right with carry
  2267.     RLC                     Rotate A left  with branch carry
  2268.     RRC                     Rotate A right with branch carry
  2269.  
  2270.     RET                     Return from subroutine
  2271.     RZ                      Return if zero
  2272.     RNZ                     Return if non zero
  2273.     RC                      Return if carry set
  2274.     RNC                     Return if carry clear
  2275.     RM                      Return if minus
  2276.     RP                      Return if plus
  2277.     RPE                     Return if parity even
  2278.     RPO                     Return if parity odd
  2279.  
  2280.     RIM                     Read interrupt mask
  2281.     RST      <int>          Restart at vector <int>
  2282.  
  2283.     SBB      <reg>          Subtract <reg> from A         with borrow
  2284.     SBB      M              Subtract indirect memory (HL) with borrow
  2285.     SBI      <data>         Subtract immediate from A     with borrow
  2286.     SUB      <reg>          Subtract <reg> from A
  2287.     SUB      M              Subtract indirect memory (HL) from A
  2288.     SUI      <data>         Subtract immediate from A
  2289.  
  2290.     SHLD     <addr>         Store HL
  2291.     SIM                     Store Interrupt mask
  2292.     SPHL                    Exchange SP with HL
  2293.  
  2294.     STA      <addr>         Store A direct memory
  2295.     STAX     B              Store A indirect using BC
  2296.     STAX     D              Store A indirect using DE
  2297.  
  2298.     STC                     Set carry
  2299.  
  2300.     XRA      <reg>          Exclusive OR A with register
  2301.     XRA      M              Exclusive Or A with indirect memory (HL)
  2302.     XRI      <data>         Exclusive Or A with immediate data
  2303.     XCHG                    Exchange DE with HL
  2304.     XTHL                    Exchange HL with top of stack
  2305.  
  2306.     See the manufacturer's data sheets for more information.
  2307.  
  2308.     TASM - Table Driven Assembler Version 2.7                    Page 52
  2309.  
  2310.  
  2311.     Z80 INSTRUCTIONS AND ADDRESSING MODES
  2312.  
  2313.     The following list shows the acceptable opcode mnemonics  and  their
  2314.     corresponding   operand  formats for the Z80  version of TASM.   The
  2315.     following symbols are used in the table:
  2316.  
  2317.             SYMBOLIC            DESCRIPTION
  2318.             -----------------------------------------------
  2319.             <addr>              Absolute address (16 bits)
  2320.             <bit>               Bit address
  2321.             <data>              Immediate data (8 bits)
  2322.             <data16>            Immediate data (16 bits)
  2323.             <disp>              Relative address
  2324.             <reg>               Register (A, B, C, D, E, H, or L)
  2325.             <rp>                Register pair (BC, DE, HL, or SP)
  2326.             <port>              Port (0 - 255)
  2327.             <cond>              Condition
  2328.                                     NZ - not zero
  2329.                                     Z  - zero
  2330.                                     NC - not carry
  2331.                                     C  - carry
  2332.                                     PO - parity odd
  2333.                                     PE - parity even
  2334.                                     P  - positive
  2335.                                     M  - minus
  2336.  
  2337.     Any valid TASM expression can appear in the  place  of the  <addr>,
  2338.     <bit>, <data>, <data16>, or <disp> symbolics.
  2339.  
  2340.     OPCODE  OPERAND         DESCRIPTION
  2341.     --------------------------------------------------------------------
  2342.     ADC  A,<data>           Add immediate with carry to accumulator
  2343.     ADC  A,<reg>            Add register with carry to accumulator
  2344.     ADC  A,(HL)             Add indirect memory with carry to accumulator
  2345.     ADC  A,(IX+<disp>)      Add indirect memory with carry to accumulator
  2346.     ADC  A,(IY+<disp>)      Add indirect memory with carry to accumulator
  2347.     ADC  HL,<rp>            Add register pair with carry to HL
  2348.  
  2349.     ADD  A,<data>           Add immediate to accumulator
  2350.     ADD  A,<reg>            Add register to accumulator
  2351.     ADD  A,(HL)             Add indirect memory to accumulator
  2352.     ADD  A,(IX+<disp>)      Add indirect memory to accumulator
  2353.     ADD  A,(IY+<disp>)      Add indirect memory to accumulator
  2354.     ADD  HL,<rp>            Add register pair to HL
  2355.     ADD  IX,<rp>            Add register pair to index register
  2356.     ADD  IY,<rp>            Add register pair to index register
  2357.  
  2358.     TASM - Table Driven Assembler Version 2.7                    Page 53
  2359.  
  2360.  
  2361.     AND  <data>             And immediate with accumulator
  2362.     AND  <reg>              And register  with accumulator
  2363.     AND  (HL)               And memory with accumulator
  2364.     AND  (IX+<disp>)        And memory with accumulator
  2365.     AND  (IY+<disp>)        And memory with accumulator
  2366.  
  2367.     BIT  <bit>,<reg>        Test <bit> in register
  2368.     BIT  <bit>,(HL)         Test <bit> in indirect memory
  2369.     BIT  <bit>,(IY+<disp>)  Test <bit> in indirect memory
  2370.     BIT  <bit>,(IX+<disp>)  Test <bit> in indirect memory
  2371.  
  2372.     CALL <addr>             Call the routine at <addr>
  2373.     CALL <cond>,<addr>      Call the routine if <cond> is satisfied
  2374.  
  2375.     CCF                     Complement carry flag
  2376.  
  2377.     CP   <data>             Compare immediate data with accumulator
  2378.     CP   <reg>              Compare register with accumulator
  2379.     CP   (HL)               Compare indirect memory with accumulator
  2380.     CP   (IX+<disp>)        Compare indirect memory with accumulator
  2381.     CP   (IY+<disp>)        Compare indirect memory with accumulator
  2382.     CPD                     Compare accumulator with memory and
  2383.                                 decrement address and byte counters
  2384.     CPDR                    Compare accumulator with memory and
  2385.                                 decrement address and byte counter,
  2386.                                 continue until match is found or
  2387.                                 byte counter is zero
  2388.  
  2389.     CPI                     Compare accumulator with memory and
  2390.                                 increment address and byte counters
  2391.     CPIR                    Compare accumulator with memory and
  2392.                                 increment address and byte counter,
  2393.                                 continue until match is found or
  2394.                                 byte counter is zero
  2395.     CPL                     Complement the accumulator
  2396.     DAA                     Decimal adjust accumulator
  2397.     DEC  <reg>              Decrement register contents
  2398.     DI                      Disable interrupts
  2399.     DJNZ <disp>             Decrement reg B and jump relative if zero
  2400.     EI                      Enable interrupts
  2401.     EX   AF,AF'             Exchange program status and alt program stat
  2402.     EX   DE,HL              Exchange DE and HL contents
  2403.     EX   (SP),HL            Exchange contents of HL and top of stack
  2404.     EX   (SP),IX            Exchange contents of IX and top of stack
  2405.     EX   (SP),IY            Exchange contents of IY and top of stack
  2406.     EXX                     Exchange register pairs and alt reg pairs
  2407.  
  2408.     TASM - Table Driven Assembler Version 2.7                    Page 54
  2409.  
  2410.     HALT                    Program execution stops
  2411.     IM   0                  Interrupt mode 0
  2412.     IM   1                  Interrupt mode 1
  2413.     IM   2                  Interrupt mode 2
  2414.     IN   A,<port>           Input port to accumulator
  2415.     INC  <reg>              Increment contents of register
  2416.     INC  <rp>               Increment contents of register pair
  2417.     INC  IX                 Increment IX
  2418.     INC  IY                 Increment IY
  2419.     INC  (HL)               Increment indirect memory
  2420.     INC  (IX+<disp>)        Increment indirect memory
  2421.     INC  (IY+<disp>)        Increment indirect memory
  2422.     IND                     Input to memory and decrement pointer
  2423.     INDR                    Input to memory and decrement pointer until
  2424.                                 byte counter is zero
  2425.     INI                     Input to memory and increment pointer
  2426.     INIR                    Input to memory and increment pointer until
  2427.                                 byte counter is zero
  2428.     IN   <reg>,(C)          Input to register
  2429.  
  2430.     JP   <addr>             Jump to location
  2431.     JP   <cond>,<addr>      Jump to location if condition satisifed
  2432.     JP   (HL)               Jump to location pointed to by HL
  2433.     JP   (IX)               Jump to location pointed to by IX
  2434.     JP   (IY)               Jump to location pointed to by IY
  2435.  
  2436.     JR   <disp>             Jump relative
  2437.     JR   C,<disp>           Jump relative if carry is set
  2438.     JR   NC,<disp>          Jump relative if carry bit is reset
  2439.     JR   NZ,<disp>          Jump relative if zero flag is reset
  2440.     JR   Z,<disp>           Jump relative if zero flag is set
  2441.  
  2442.     LD   A,I                Move interrupt vector contents to accumulator
  2443.     LD   A,R                Move refresh reg contents to accumulator
  2444.     LD   A,(<addr>)         Load accumulator indirect from memory
  2445.     LD   A,(<rp>)           Load accumulator indirect from memory by <rp>
  2446.     LD   <reg>,<reg>        Load source register to destination register
  2447.     LD   <rp>,(<addr>)      Load register pair indirect from memory
  2448.     LD   IX,(<addr>)        Load IX indirect from memory
  2449.     LD   IY,(<addr>)        Load IY indirect from memory
  2450.     LD   I,A                Load interrup vector from accumulator
  2451.     LD   R,A                Load refresh register from accumulator
  2452.     LD   <reg>,<data>       Load register with immediate data
  2453.     LD   <rp>,<data16>      Load register pair with immediate data
  2454.     LD   IX,<data16>        Load  IX  with immediate data
  2455.     LD   IY,<data16>        Load  IY  with immediate data
  2456.     LD   <reg>,(HL)         Load register indirect from memory
  2457.  
  2458.     TASM - Table Driven Assembler Version 2.7                    Page 55
  2459.  
  2460.     LD   <reg>,(IX+<disp>)  Load register indirect from memory
  2461.     LD   <reg>,(IY+<disp>)  Load register indirect from memory
  2462.     LD   SP,HL              Load contents of HL to stack pointer
  2463.     LD   SP,IX              Load contents of IX to stack pointer
  2464.     LD   SP,IY              Load contents of IY to stack pointer
  2465.     LD   (addr),A           Load contents of A to memory
  2466.     LD   (<addr>),HL        Load contents of HL to memory
  2467.     LD   (<addr>),<rp>      Load contents of register pair to memory
  2468.     LD   (<addr>),IX        Load contents of IX to memory
  2469.     LD   (<addr>),IY        Load contents of IY to memory
  2470.     LD   (HL),<data>        Load immediate into indirect memory
  2471.     LD   (IX+<disp>),<data> Load immediate into indirect memory
  2472.     LD   (IY+<disp>),<data> Load immediate into indirect memory
  2473.     LD   (HL),<reg>         Load register  into indirect memory
  2474.     LD   (IX+<disp>),<reg>  Load register  into indirect memory
  2475.     LD   (IY+<disp>),<reg>  Load register  into indirect memory
  2476.     LD   (<rp>),A           Load accumulator into indirect memory
  2477.     LDD                     Transfer data between memory and decrement
  2478.                                 destination and source addresses
  2479.     LDDR                    Transfer data between memory until byte
  2480.                                 counter is zero, decrement destintation
  2481.                                 and source addresses
  2482.     LDI                     Transfer data between memory and increment
  2483.                                 destination and source addresses
  2484.     LDIR                    Transfer data between memory until byte
  2485.                                 counter is zero, increment destination
  2486.                                 and source addresses
  2487.     NEG                     Negate contents of accumulator
  2488.     NOP                     No operation
  2489.     OR   <data>             Or immediate with accumulator
  2490.     OR   <reg>              Or register with accumulator
  2491.     OR   (HL)               Or indirect memory with accumulator
  2492.     OR   (IX+<disp>)        Or indirect memory with accumulator
  2493.     OR   (IY+<disp>)        Or indirect memory with accumulator
  2494.     OUT  (C),<reg>          Output from registor
  2495.     OUTD                    Output from memory, decrement address
  2496.     OTDR                    Output from memory, decrement address
  2497.                                 continue until reg B is zero
  2498.     OUTI                    Output from memory, increment address
  2499.     OTIR                    Output from memory, increment address
  2500.                                 continue until reg B is zero
  2501.     OUT  <port>,A           Output from accumulator
  2502.     POP  <rp>               Load register pair from top of stack
  2503.     POP  IX                 Load IX from top of stack
  2504.     POP  IY                 Load IY from top of stack
  2505.     PUSH <rp>               Store resister pair on top of stack
  2506.     PUSH IX                 Store IX on top of stack
  2507.  
  2508.     TASM - Table Driven Assembler Version 2.7                    Page 56
  2509.  
  2510.     PUSH IY                 Store IY on top of stack
  2511.     RES  <bit>,<reg>        Reset register bit
  2512.     RES  <bit>,(HL)         Reset bit at indirect memory location
  2513.     RES  <bit>,(IX+disp)    Reset bit at indirect memory location
  2514.     RES  <bit>,(IY+<disp>)  Reset bit at indirect memory location
  2515.     RET                     Return from subroutine
  2516.     RET  <cond>             Return from subroutine if condition true
  2517.     RETI                    Return from interrupt
  2518.     RETN                    Return from non-maskable interrupt
  2519.     RL   <reg>              Rotate left through carry register contents
  2520.     RL   (HL)               Rotate left through carry indirect memory
  2521.     RL   (IX+<disp>)        Rotate left through carry indirect memory
  2522.     RL   (IY+<disp>)        Rotate left through carry indirect memory
  2523.     RLA                     Rotate left through carry accumulator
  2524.     RLC  <reg>              Rotate left branch  carry register contents
  2525.     RLC  (HL)               Rotate left branch  carry indirect memory
  2526.     RLC  (IX+<disp>)        Rotate left branch  carry indirect memory
  2527.     RLC  (IY+<disp>)        Rotate left branch  carry indirect memory
  2528.     RLCA                    Rotate left accumulator
  2529.     RLD                     Rotate one BCD digit left between the
  2530.                                 accumulator and memory
  2531.     RR   <reg>              Rotate right through carry register contents
  2532.     RR   (HL)               Rotate right through carry indirect memory
  2533.     RR   (IX+<disp>)        Rotate right through carry indirect memory
  2534.     RR   (IY+<disp>)        Rotate right through carry indirect memory
  2535.     RRA                     Rotate right through carry accumulator
  2536.     RRC  <reg>              Rotate right branch  carry register contents
  2537.     RRC  (HL)               Rotate right branch  carry indirect memory
  2538.     RRC  (IX+<disp>)        Rotate right branch  carry indirect memory
  2539.     RRC  (IY+<disp>)        Rotate right branch  carry indirect memory
  2540.     RRCA                    Rotate right branch  carry accumulator
  2541.     RRD                     Rotate one BCD digit right between the
  2542.                                 accumulator and memory
  2543.     RST                     Restart
  2544.     SBC  A,<data>           Subtract data            from A with borrow
  2545.     SBC  A,<reg>            Subtract register        from A with borrow
  2546.     SBC  A,(HL)             Subtract indirect memory from A with borrow
  2547.     SBC  A,(IX+<disp>)      Subtract indirect memory from A with borrow
  2548.     SBC  A,(IY+<disp>)      Subtract indirect memory from A with borrow
  2549.     SBC  HL,<rp>            Subtract register pair from HL with borrow
  2550.     SCF                     Set carry flag
  2551.     SET  <bit>,<reg>        Set register bit
  2552.     SET  <bit>,(HL)         Set indirect memory bit
  2553.     SET  <bit>,(IX+<disp>)  Set indirect memory bit
  2554.     SET  <bit>,(IY+<disp>)  Set indirect memory bit
  2555.     SLA  <reg>              Shift register left arithmetic
  2556.     SLA  (HL)               Shift indirect memory left arithmetic
  2557.  
  2558.     TASM - Table Driven Assembler Version 2.7                    Page 57
  2559.  
  2560.     SLA  (IX+<disp>)        Shift indirect memory left arithmetic
  2561.     SLA  (IY+<disp>)        Shift indirect memory left arithmetic
  2562.     SRA  <reg>              Shift register right arithmetic
  2563.     SRA  (HL)               Shift indirect memory right arithmetic
  2564.     SRA  (IX+<disp>)        Shift indirect memory right arithmetic
  2565.     SRA  (IY+<disp>)        Shift indirect memory right arithmetic
  2566.     SRL  <reg>              Shift register right logical
  2567.     SRL  (HL)               Shift indirect memory right logical
  2568.     SRL  (IX+<disp>)        Shift indirect memory right logical
  2569.     SRL  (IY+<disp>)        Shift indirect memory right logical
  2570.     SUB  <data>             Subtract immediate from accumulator
  2571.     SUB  <reg>              Subtract register from accumulator
  2572.     SUB  (HL)               Subtract indirect memory from accumulator
  2573.     SUB  (IX+<disp>)        Subtract indirect memory from accumulator
  2574.     SUB  (IY+<disp>)        Subtract indirect memory from accumulator
  2575.     XOR  <data>             Exclusive or immediate with accumulator
  2576.     XOR  <reg>              Exclusive or register with accumulator
  2577.     XOR  (HL)               Exclusive or indirect memory with accumulator
  2578.     XOR  (IX+<disp>)        Exclusive or indirect memory with accumulator
  2579.     XOR  (IY+<disp>)        Exclusive or indirect memory with accumulator
  2580.  
  2581.     See the manufacturer's data sheets for more information.
  2582.  
  2583.     TASM - Table Driven Assembler Version 2.7                    Page 58
  2584.  
  2585.  
  2586.     6805 INSTRUCTIONS AND ADDRESSING MODES
  2587.  
  2588.     The following list shows the acceptable opcode mnemonics  and  their
  2589.     corresponding   operand  formats for the 6805  version of TASM.   The
  2590.     following symbols are used in the table:
  2591.  
  2592.             SYMBOLIC            DESCRIPTION
  2593.             -----------------------------------------------
  2594.             <addr>              Absolute address (16 bits)
  2595.             <addr8>             Absolute address (8 bits)
  2596.             <bit>               Bit address
  2597.             <data>              Immediate data (8 bits)
  2598.             <rel>               Relative address
  2599.  
  2600.     Any valid TASM expression can appear in the  place  of the  <addr>,
  2601.     <addr8>, <bit>, <data>, or <rel> symbolics.
  2602.  
  2603.     OPCODE  OPERAND         DESCRIPTION
  2604.     --------------------------------------------------------------
  2605.     ADC     #<data>         Add with carry, immediate
  2606.     ADC     ,X              Add with carry, indexed, no offset
  2607.     ADC     <addr8>,X       Add with carry, indexed, 1 byte offset
  2608.     ADC     <addr>,X        Add with carry, indexed, 2 byte offset
  2609.     ADC     <addr8>         Add with carry, direct
  2610.     ADC     <addr>          Add with carry, extended
  2611.  
  2612.     ADD     #<data>         Add, immediate
  2613.     ADD     ,X              Add, indexed, no offset
  2614.     ADD     <addr8>,X       Add, indexed, 1 byte offset
  2615.     ADD     <addr>,X        Add, indexed, 2 byte offset
  2616.     ADD     <addr8>         Add, direct
  2617.     ADD     <addr>          Add, extended
  2618.  
  2619.     AND     #<data>         And, immediate
  2620.     AND     ,X              And, indexed, no offset
  2621.     AND     <addr8>,X       And, indexed, 1 byte offset
  2622.     AND     <addr>,X        And, indexed, 2 byte offset
  2623.     AND     <addr8>         And, direct
  2624.     AND     <addr>          And, extended
  2625.  
  2626.     ASLA                    Arithmetic Shift Left, accumulator
  2627.     ASLX                    Arithmetic Shift Left, index register
  2628.     ASL     <addr8>         Arithmetic Shift Left, direct
  2629.     ASL     ,X              Arithmetic Shift Left, indexed, no offset
  2630.     ASL     <addr8>,X       Arithmetic Shift Left, indexed, 1 byte offset
  2631.  
  2632.  
  2633.     TASM - Table Driven Assembler Version 2.7                    Page 59
  2634.  
  2635.     ASRA                    Arithmetic Shift Right, accumulator
  2636.     ASRX                    Arithmetic Shift Right, index register
  2637.     ASR     <addr8>         Arithmetic Shift Right, direct
  2638.     ASR     ,X              Arithmetic Shift Right, indexed, no offset
  2639.     ASR     <addr8>,X       Arithmetic Shift Right, indexed, 1 byte offset
  2640.  
  2641.     BCC     <rel>           Branch if carry clear
  2642.     BCLR    <bit>,<addr8>   Bit Clear in memory
  2643.     BCS     <rel>           Branch if carry set
  2644.     BEQ     <rel>           Branch if equal
  2645.     BHCC    <rel>           Branch if half carry clear
  2646.     BHCS    <rel>           Branch if half carry set
  2647.     BHI     <rel.           Branch if higher
  2648.     BHS     <rel>           Branch if higher or same
  2649.     BIH     <rel>           Branch if interrupt line is high
  2650.     BIL     <rel>           Branch if interrupt is low
  2651.  
  2652.     BIT     #<data>         Bit test, immediate
  2653.     BIT     ,X              Bit test, indexed, no offset
  2654.     BIT     <addr8>,X       Bit test, indexed, 1 byte offset
  2655.     BIT     <addr>,X        Bit test, indexed, 2 byte offset
  2656.     BIT     <addr8>         Bit test, direct
  2657.     BIT     <addr>          Bit test, extended
  2658.  
  2659.     BLO     <rel>           Branch if lower
  2660.     BLS     <rel>           Branch if lower or same
  2661.     BMC     <rel>           Branch if interrupt mask is clear
  2662.     BMI     <rel>           Branch if minus
  2663.     BMS     <rel>           Branch if interuupt mask bit is set
  2664.     BNE     <rel>           Branch if not equal
  2665.     BPL     <rel>           Branch if plus
  2666.     BRA     <rel>           Branch always
  2667.     BRCLR   <bit>,<addr8>,<rel>     Branch if bit is clear
  2668.     BRN     <rel>           Branch never
  2669.     BRSET   <bit>,<addr8>,<rel>     Branch if bit is set
  2670.     BSET    <bit>,<addr8>   Bit set in memory
  2671.     BSR     <rel>           Branch to subroutine
  2672.  
  2673.     CLC                     Clear carry bit
  2674.     CLI                     Clear interuupt mask bit
  2675.  
  2676.     CLRA                    Clear, accumulator
  2677.     CLRX                    Clear, index register
  2678.     CLR     <addr8>         Clear, direct
  2679.     CLR     ,X              Clear, indexed, no offset
  2680.     CLR     <addr8>,X       Clear, indexed, 1 byte offset
  2681.  
  2682.  
  2683.     TASM - Table Driven Assembler Version 2.7                    Page 60
  2684.  
  2685.     CMP     #<data>         Compare Acc, immediate
  2686.     CMP     ,X              Compare Acc, indexed, no offset
  2687.     CMP     <addr8>,X       Compare Acc, indexed, 1 byte offset
  2688.     CMP     <addr>,X        Compare Acc, indexed, 2 byte offset
  2689.     CMP     <addr8>         Compare Acc, direct
  2690.     CMP     <addr>          Compare Acc, extended
  2691.  
  2692.     COMA                    Complement, accumulator
  2693.     COMX                    Complement, index register
  2694.     COM     <addr8>         Complement, direct
  2695.     COM     ,X              Complement, indexed, no offset
  2696.     COM     <addr8>,X       Complement, indexed, 1 byte offset
  2697.  
  2698.     CPX     #<data>         Compare Index, immediate
  2699.     CPX     ,X              Compare Index, indexed, no offset
  2700.     CPX     <addr8>,X       Compare Index, indexed, 1 byte offset
  2701.     CPX     <addr>,X        Compare Index, indexed, 2 byte offset
  2702.     CPX     <addr8>         Compare Index, direct
  2703.     CPX     <addr>          Compare Index, extended
  2704.  
  2705.     DECA                    Decrement, accumulator
  2706.     DECX                    Decrement, index register
  2707.     DEX                     Decrement, index register (alternate of DECX)
  2708.     DEC     <addr8>         Decrement, direct
  2709.     DEC     ,X              Decrement, indexed, no offset
  2710.     DEC     <addr8>,X       Decrement, indexed, 1 byte offset
  2711.  
  2712.     EOR     #<data>         Exclusive OR, immediate
  2713.     EOR     ,X              Exclusive OR, indexed, no offset
  2714.     EOR     <addr8>,X       Exclusive OR, indexed, 1 byte offset
  2715.     EOR     <addr>,X        Exclusive OR, indexed, 2 byte offset
  2716.     EOR     <addr8>         Exclusive OR, direct
  2717.     EOR     <addr>          Exclusive OR, extended
  2718.  
  2719.     INCA                    Increment, accumulator
  2720.     INCX                    Increment, index register
  2721.     INX                     Increment, index register (alternate of INCX)
  2722.     INC     <addr8>         Increment, direct
  2723.     INC     ,X              Increment, indexed, no offset
  2724.     INC     <addr8>,X       Increment, indexed, 1 byte offset
  2725.  
  2726.     JMP     ,X              Jump, indexed, no offset
  2727.     JMP     <addr8>,X       Jump, indexed, 1 byte offset
  2728.     JMP     <addr>,X        Jump, indexed, 2 byte offset
  2729.     JMP     <addr8>         Jump, direct
  2730.     JMP     <addr>          Jump, extended
  2731.  
  2732.  
  2733.     TASM - Table Driven Assembler Version 2.7                    Page 61
  2734.  
  2735.     JSR     ,X              Jump Subroutine, indexed, no offset
  2736.     JSR     <addr8>,X       Jump Subroutine, indexed, 1 byte offset
  2737.     JSR     <addr>,X        Jump Subroutine, indexed, 2 byte offset
  2738.     JSR     <addr8>         Jump Subroutine, direct
  2739.     JSR     <addr>          Jump Subroutine, extended
  2740.  
  2741.     LDA     #<data>         Load Acc, immediate
  2742.     LDA     ,X              Load Acc, indexed, no offset
  2743.     LDA     <addr8>,X       Load Acc, indexed, 1 byte offset
  2744.     LDA     <addr>,X        Load Acc, indexed, 2 byte offset
  2745.     LDA     <addr8>         Load Acc, direct
  2746.     LDA     <addr>          Load Acc, extended
  2747.  
  2748.     LDX     #<data>         Load Index, immediate
  2749.     LDX     ,X              Load Index, indexed, no offset
  2750.     LDX     <addr8>,X       Load Index, indexed, 1 byte offset
  2751.     LDX     <addr>,X        Load Index, indexed, 2 byte offset
  2752.     LDX     <addr8>         Load Index, direct
  2753.     LDX     <addr>          Load Index, extended
  2754.  
  2755.     LSLA                    Logical Shift Left, accumulator
  2756.     LSLX                    Logical Shift Left, index register
  2757.     LSL     <addr8>         Logical Shift Left, direct
  2758.     LSL     ,X              Logical Shift Left, indexed, no offset
  2759.     LSL     <addr8>,X       Logical Shift Left, indexed, 1 byte offset
  2760.  
  2761.     LSRA                    Logical Shift Right, accumulator
  2762.     LSRX                    Logical Shift Right, index register
  2763.     LSR     <addr8>         Logical Shift Right, direct
  2764.     LSR     ,X              Logical Shift Right, indexed, no offset
  2765.     LSR     <addr8>,X       Logical Shift Right, indexed, 1 byte offset
  2766.  
  2767.     NEGA                    Negate, accumulator
  2768.     NEGX                    Negate, index register
  2769.     NEG     <addr8>         Negate, direct
  2770.     NEG     ,X              Negate, indexed, no offset
  2771.     NEG     <addr8>,X       Negate, indexed, 1 byte offset
  2772.  
  2773.     NOP                     No Operation
  2774.  
  2775.     ORA     #<data>         Inclusive OR Acc, immediate
  2776.     ORA     ,X              Inclusive OR Acc, indexed, no offset
  2777.     ORA     <addr8>,X       Inclusive OR Acc, indexed, 1 byte offset
  2778.     ORA     <addr>,X        Inclusive OR Acc, indexed, 2 byte offset
  2779.     ORA     <addr8>         Inclusive OR Acc, direct
  2780.     ORA     <addr>          Inclusive OR Acc, extended
  2781.  
  2782.  
  2783.     TASM - Table Driven Assembler Version 2.7                    Page 62
  2784.  
  2785.     ROLA                    Rotate Left thru Carry, accumulator
  2786.     ROLX                    Rotate Left thru Carry, index register
  2787.     ROL     <addr8>         Rotate Left thru Carry, direct
  2788.     ROL     ,X              Rotate Left thru Carry, indexed, no offset
  2789.     ROL     <addr8>,X       Rotate Left thru Carry, indexed, 1 byte offset
  2790.  
  2791.     RORA                    Rotate Right thru Carry, accumulator
  2792.     RORX                    Rotate Right thru Carry, index register
  2793.     ROR     <addr8>         Rotate Right thru Carry, direct
  2794.     ROR     ,X              Rotate Right thru Carry, indexed, no offset
  2795.     ROR     <addr8>,X       Rotate Right thru Carry, indexed, 1 byte offset
  2796.  
  2797.     RSP                     Reset Stack Pointer
  2798.     RTI                     Return from Interrupt
  2799.     RTS                     Return from Subroutine
  2800.  
  2801.     SBC     #<data>         Subtract with Carry, immediate
  2802.     SBC     ,X              Subtract with Carry, indexed, no offset
  2803.     SBC     <addr8>,X       Subtract with Carry, indexed, 1 byte offset
  2804.     SBC     <addr>,X        Subtract with Carry, indexed, 2 byte offset
  2805.     SBC     <addr8>         Subtract with Carry, direct
  2806.     SBC     <addr>          Subtract with Carry, extended
  2807.  
  2808.     SEC                     Set carry bit
  2809.     SEI                     Set interrupt Mask bit
  2810.  
  2811.     STA     #<data>         Store Acc, immediate
  2812.     STA     ,X              Store Acc, indexed, no offset
  2813.     STA     <addr8>,X       Store Acc, indexed, 1 byte offset
  2814.     STA     <addr>,X        Store Acc, indexed, 2 byte offset
  2815.     STA     <addr8>         Store Acc, direct
  2816.     STA     <addr>          Store Acc, extended
  2817.  
  2818.     STOP                    Enable IRQ, Stop Oscillator
  2819.  
  2820.     STX     #<data>         Store Index, immediate
  2821.     STX     ,X              Store Index, indexed, no offset
  2822.     STX     <addr8>,X       Store Index, indexed, 1 byte offset
  2823.     STX     <addr>,X        Store Index, indexed, 2 byte offset
  2824.     STX     <addr8>         Store Index, direct
  2825.     STX     <addr>          Store Index, extended
  2826.  
  2827.     SUB     #<data>         Subtract, immediate
  2828.     SUB     ,X              Subtract, indexed, no offset
  2829.     SUB     <addr8>,X       Subtract, indexed, 1 byte offset
  2830.     SUB     <addr>,X        Subtract, indexed, 2 byte offset
  2831.     SUB     <addr8>         Subtract, direct
  2832.  
  2833.     TASM - Table Driven Assembler Version 2.7                    Page 63
  2834.  
  2835.     SUB     <addr>          Subtract, extended
  2836.  
  2837.     SWI                     Software Interrupt
  2838.  
  2839.     TAX                     Transfer Acc to Index
  2840.  
  2841.     TSTA                    Test for neg or zero, accumulator
  2842.     TSTX                    Test for neg or zero, index register
  2843.     TST     <addr8>         Test for neg or zero, direct
  2844.     TST     ,X              Test for neg or zero, indexed, no offset
  2845.     TST     <addr8>,X       Test for neg or zero, indexed, 1 byte offset
  2846.  
  2847.     TXA                     Transfer Index to Acc
  2848.  
  2849.     WAIT                    Enable Interrupt, Stop Processor
  2850.  
  2851.  
  2852.     See the manufacturer's data sheets for more information.
  2853.  
  2854.  
  2855.     TASM - Table Driven Assembler Version 2.7                    Page 64
  2856.  
  2857.  
  2858.     TMS32010 INSTRUCTIONS AND ADDRESSING MODES
  2859.  
  2860.     The following list shows the acceptable opcode mnemonics  and  their
  2861.     corresponding   operand  formats for the TMS32010   version of TASM.
  2862.     The following symbols are used in the table:
  2863.  
  2864.             SYMBOLIC            DESCRIPTION
  2865.             -----------------------------------------------
  2866.             <ar>                Auxiliary register (AR0, AR1)
  2867.             <arp>               Auxiliary register pointer
  2868.             <dma>               Direct memory address
  2869.             <pma>               Program memory address
  2870.             <port>              Port address (0 - 7)
  2871.             <shift>             Shift count  (0 - 15)
  2872.             <const1>            Constant (1 bit)
  2873.             <const8>            Constant (8 bit)
  2874.             <const13>           Constant (13 bit)
  2875.  
  2876.     Any valid TASM expression can appear in the  place  of  any  of  the
  2877.     above symbolics.
  2878.  
  2879.     OPCODE   OPERAND            DESCRIPTION
  2880.     --------------------------------------------------------------------
  2881.     ABS                         Absolute value of ACC
  2882.  
  2883.     ADD      *+,<shift>,<arp>   Add to ACC with shift
  2884.     ADD      *-,<shift>,<arp>
  2885.     ADD      *, <shift>,<arp>
  2886.     ADD      *+,<shift>
  2887.     ADD      *-,<shift>
  2888.     ADD      *, <shift>
  2889.     ADD      *+
  2890.     ADD      *-
  2891.     ADD      *
  2892.     ADD      <dma>,<shift>
  2893.     ADD      <dma>
  2894.  
  2895.     ADDH     *+,<arp>           Add to high-order ACC bits
  2896.     ADDH     *-,<arp>
  2897.     ADDH     *, <arp>
  2898.     ADDH     *+
  2899.     ADDH     *-
  2900.     ADDH     *
  2901.     ADDH     <dma>
  2902.  
  2903.     ADDS     *+,<arp>           Add to ACC with no sign extension
  2904.  
  2905.     TASM - Table Driven Assembler Version 2.7                    Page 65
  2906.  
  2907.     ADDS     *-,<arp>
  2908.     ADDS     *, <arp>
  2909.     ADDS     *+
  2910.     ADDS     *-
  2911.     ADDS     *
  2912.     ADDS     <dma>
  2913.  
  2914.     AND      *+,<arp>           AND with ACC
  2915.     AND      *-,<arp>
  2916.     AND      *, <arp>
  2917.     AND      *+
  2918.     AND      *-
  2919.     AND      *
  2920.     AND      <dma>
  2921.  
  2922.     APAC                        Add P register to ACC
  2923.  
  2924.     B        <pma>              Branch unconditionally
  2925.     BANZ     <pma>              Branch on auxiliary register not zero
  2926.     BGEZ     <pma>              Branch if ACC >= 0
  2927.     BGZ      <pma>              Branch if ACC >  0
  2928.     BIOZ     <pma>              Branch on BIO- = 0
  2929.     BLEZ     <pma>              Branch if ACC <= 0
  2930.     BLZ      <pma>              Branch if ACC <  0
  2931.     BNZ      <pma>              Branch if ACC <> 0
  2932.     BV       <pma>              Branch on overflow
  2933.     BZ       <pma>              Branch if ACC =  0
  2934.  
  2935.     CALA                        Call subroutine from ACC
  2936.     CALL     <pma>              Call subroutine at <pma>
  2937.  
  2938.     DINT                        Disable interrupt
  2939.  
  2940.     DMOV     *+,<arp>           Data move in memory
  2941.     DMOV     *-,<arp>
  2942.     DMOV     *, <arp>
  2943.     DMOV     *+
  2944.     DMOV     *-
  2945.     DMOV     *
  2946.     DMOV     <dma>
  2947.  
  2948.     EINT                        Enable Interrupt
  2949.  
  2950.     IN       *+,<port> ,<arp>   Input data from port
  2951.     IN       *-,<port> ,<arp>
  2952.     IN       * ,<port> ,<arp>
  2953.     IN       *+,<port>
  2954.  
  2955.     TASM - Table Driven Assembler Version 2.7                    Page 66
  2956.  
  2957.     IN       *-,<port>
  2958.     IN       * ,<port>
  2959.     IN       <dma>,<port>
  2960.  
  2961.     LAC      *+,<shift>,<arp>   Load ACC with shift
  2962.     LAC      *-,<shift>,<arp>
  2963.     LAC      *, <shift>,<arp>
  2964.     LAC      *+,<shift>
  2965.     LAC      *-,<shift>
  2966.     LAC      *, <shift>
  2967.     LAC      *+
  2968.     LAC      *-
  2969.     LAC      *
  2970.     LAC      <dma>,<shift>
  2971.     LAC      <dma>
  2972.  
  2973.     LACK     <const8>                   Load ACC with 8 bit constant
  2974.  
  2975.     LAR      <ar>,*+,<arp>              Load auxiliary Register
  2976.     LAR      <ar>,*-,<arp>
  2977.     LAR      <ar>,*, <arp>
  2978.     LAR      <ar>,*+
  2979.     LAR      <ar>,*-
  2980.     LAR      <ar>,*
  2981.     LAR      <ar>,<dma>
  2982.  
  2983.     LARK     <ar>,<const8>              Load aux register with constant
  2984.     LARP     <const1>                   Load aux register pointer immed
  2985.  
  2986.     LDP      *+,<arp>                   Load data memory page pointer
  2987.     LDP      *-,<arp>
  2988.     LDP      *, <arp>
  2989.     LDP      *+
  2990.     LDP      *-
  2991.     LDP      *
  2992.     LDP      <dma>
  2993.  
  2994.     LDPK     <const1>                   Load data page pointer immediate
  2995.  
  2996.     LST      *+,<arp>                   Load status from data memory
  2997.     LST      *-,<arp>
  2998.     LST      *, <arp>
  2999.     LST      *+
  3000.     LST      *-
  3001.     LST      *
  3002.     LST      <dma>
  3003.  
  3004.  
  3005.     TASM - Table Driven Assembler Version 2.7                    Page 67
  3006.  
  3007.     LT       *+,<arp>                   Load T register
  3008.     LT       *-,<arp>
  3009.     LT       *, <arp>
  3010.     LT       *+
  3011.     LT       *-
  3012.     LT       *
  3013.     LT       <dma>
  3014.  
  3015.     LTA      *+,<arp>                   Load T register and accumulate
  3016.     LTA      *-,<arp>                     product
  3017.     LTA      *, <arp>
  3018.     LTA      *+
  3019.     LTA      *-
  3020.     LTA      *
  3021.     LTA      <dma>
  3022.  
  3023.     LTD      *+,<arp>                   Load T reg, accumulate product,
  3024.     LTD      *-,<arp>                     and move
  3025.     LTD      *, <arp>
  3026.     LTD      *+
  3027.     LTD      *-
  3028.     LTD      *
  3029.     LTD      <dma>
  3030.  
  3031.     MAR      *+,<arp>                   Modify auxiliary register
  3032.     MAR      *-,<arp>
  3033.     MAR      *, <arp>
  3034.     MAR      *+
  3035.     MAR      *-
  3036.     MAR      *
  3037.     MAR      <dma>
  3038.  
  3039.     MPY      *+,<arp>                   Multiply
  3040.     MPY      *-,<arp>
  3041.     MPY      *, <arp>
  3042.     MPY      *+
  3043.     MPY      *-
  3044.     MPY      *
  3045.     MPY      <dma>
  3046.  
  3047.     MPYK     <const13>                  Multiply immediate
  3048.  
  3049.     NOP                                 No Operation
  3050.  
  3051.     OR       *+,<arp>                   OR  with low order bits of ACC
  3052.     OR       *-,<arp>
  3053.     OR       *, <arp>
  3054.  
  3055.     TASM - Table Driven Assembler Version 2.7                    Page 68
  3056.  
  3057.     OR       *+
  3058.     OR       *-
  3059.     OR       *
  3060.     OR       <dma>
  3061.  
  3062.     OUT      *+,<port>,<arp>            Output data to port
  3063.     OUT      *-,<port>,<arp>
  3064.     OUT      *, <port>,<arp>
  3065.     OUT      *+,<port>
  3066.     OUT      *-,<port>
  3067.     OUT      *, <port>
  3068.     OUT      <dma>,<port>
  3069.  
  3070.     PAC                                 Load ACC with P register
  3071.     POP                                 Pop top of stack to ACC
  3072.     PUSH                                Push ACC onto stack
  3073.     RET                                 Return from subroutine
  3074.     ROVM                                Reset overflow mode register
  3075.  
  3076.     SACH     *+,<shift>,<arp>           Store ACC high with shift
  3077.     SACH     *-,<shift>,<arp>             Note: shift can only be 0, 1,
  3078.     SACH     *, <shift>,<arp>                   or 4
  3079.     SACH     *+,<shift>
  3080.     SACH     *-,<shift>
  3081.     SACH     *, <shift>
  3082.     SACH     *+
  3083.     SACH     *-
  3084.     SACH     *
  3085.     SACH     <dma>,<shift>
  3086.     SACH     <dma>
  3087.  
  3088.     SACL     *+,<arp>                   Store ACC low
  3089.     SACL     *-,<arp>
  3090.     SACL     *, <arp>
  3091.     SACL     *+
  3092.     SACL     *-
  3093.     SACL     *
  3094.     SACL     <dma>
  3095.  
  3096.     SAR      <ar>,*+,<arp>              Store auxiliary Register
  3097.     SAR      <ar>,*-,<arp>
  3098.     SAR      <ar>,*, <arp>
  3099.     SAR      <ar>,*+
  3100.     SAR      <ar>,*-
  3101.     SAR      <ar>,*
  3102.     SAR      <ar>,<dma>
  3103.  
  3104.  
  3105.     TASM - Table Driven Assembler Version 2.7                    Page 69
  3106.  
  3107.     SOVM                                Set overflow mode register
  3108.     SPAC                                Subtract P register from ACC
  3109.  
  3110.     SST      *+,<arp>                   Store status
  3111.     SST      *-,<arp>
  3112.     SST      *, <arp>
  3113.     SST      *+
  3114.     SST      *-
  3115.     SST      *
  3116.     SST      <dma>
  3117.  
  3118.     SUB      *+,<shift>,<arp>           Subtract from ACC with shift
  3119.     SUB      *-,<shift>,<arp>
  3120.     SUB      *, <shift>,<arp>
  3121.     SUB      *+,<shift>
  3122.     SUB      *-,<shift>
  3123.     SUB      *, <shift>
  3124.     SUB      *+
  3125.     SUB      *-
  3126.     SUB      *
  3127.     SUB      <dma>,<shift>
  3128.     SUB      <dma>
  3129.  
  3130.     SUBC     *+,<arp>                   Conditional subtract
  3131.     SUBC     *-,<arp>
  3132.     SUBC     *, <arp>
  3133.     SUBC     *+
  3134.     SUBC     *-
  3135.     SUBC     *
  3136.     SUBC     <dma>
  3137.  
  3138.     SUBH     *+,<arp>                   Subtract from high-order ACC
  3139.     SUBH     *-,<arp>
  3140.     SUBH     *, <arp>
  3141.     SUBH     *+
  3142.     SUBH     *-
  3143.     SUBH     *
  3144.     SUBH     <dma>
  3145.  
  3146.     SUBS     *+,<arp>                   Subtract from low ACC with
  3147.     SUBS     *-,<arp>                     sign-extension suppressed
  3148.     SUBS     *, <arp>
  3149.     SUBS     *+
  3150.     SUBS     *-
  3151.     SUBS     *
  3152.     SUBS     <dma>
  3153.  
  3154.  
  3155.     TASM - Table Driven Assembler Version 2.7                    Page 70
  3156.  
  3157.     TBLR     *+,<arp>                   Table Read
  3158.     TBLR     *-,<arp>
  3159.     TBLR     *, <arp>
  3160.     TBLR     *+
  3161.     TBLR     *-
  3162.     TBLR     *
  3163.     TBLR     <dma>
  3164.  
  3165.     TBLW     *+,<arp>                   Table Write
  3166.     TBLW     *-,<arp>
  3167.     TBLW     *, <arp>
  3168.     TBLW     *+
  3169.     TBLW     *-
  3170.     TBLW     *
  3171.     TBLW     <dma>
  3172.  
  3173.     XOR      *+,<arp>                   Exclusive OR with low bits of ACC
  3174.     XOR      *-,<arp>
  3175.     XOR      *, <arp>
  3176.     XOR      *+
  3177.     XOR      *-
  3178.     XOR      *
  3179.     XOR      <dma>
  3180.  
  3181.     ZAC                                 Zero the ACC
  3182.  
  3183.     ZALH     *+,<arp>                   Zero ACC and load high
  3184.     ZALH     *-,<arp>
  3185.     ZALH     *, <arp>
  3186.     ZALH     *+
  3187.     ZALH     *-
  3188.     ZALH     *
  3189.     ZALH     <dma>
  3190.  
  3191.     ZALS     *+,<arp>                   Zero ACC and load low with
  3192.     ZALS     *-,<arp>                     sign extension suppressed
  3193.     ZALS     *, <arp>
  3194.     ZALS     *+
  3195.     ZALS     *-
  3196.     ZALS     *
  3197.     ZALS     <dma>
  3198.  
  3199.  
  3200.     See manufacturer's data for more information.
  3201.  
  3202.     TASM - Table Driven Assembler Version 2.7                    Page 71
  3203.  
  3204.  
  3205.     TASM DISTRIBUTION FILES
  3206.  
  3207.     TASM  is  distributed  in  two  different  packages  - an executable
  3208.     package and a source package.  The files  associated  with  each  of
  3209.     these are described below:
  3210.  
  3211.             EXECUTABLE (SHAREWARE) PACKAGE
  3212.             ------------------------------------------------------------
  3213.             1.  TASM.EXE          - TASM Assembler, executable
  3214.             2.  TASM48.TAB        - 8048 Instruction definition table
  3215.             3.  TASM51.TAB        - 8051 Instruction definition table
  3216.             4.  TASM65.TAB        - 6502 Instruction definition table
  3217.             5.  TASM85.TAB        - 8085 Instruction definition table
  3218.             6.  TASM80.TAB        - Z80  Instruction definition table
  3219.             7.  TASM05.TAB        - 6805 Instruction definition table
  3220.             8.  TASM.DOC          - TASM Documentation
  3221.             9.  README            - Brief Explanation of Disk contents
  3222.             10. ORDER.FRM         - Order Form
  3223.             11. COPYRIGH.T        - Copyright notice
  3224.  
  3225.             SOURCE PACKAGE
  3226.             ------------------------------------------------------------
  3227.             1.  TASM.EXE          - TASM Assembler, executable
  3228.             2.  TASM48.TAB        - 8048 Instruction definition table
  3229.             3.  TASM51.TAB        - 8051 Instruction definition table
  3230.             4.  TASM65.TAB        - 6502 Instruction definition table
  3231.             5.  TASM85.TAB        - 8085 Instruction definition table
  3232.             6.  TASM80.TAB        - Z80  Instruction definition table
  3233.             7.  TASM80.TAB        - 6805 Instruction definition table
  3234.             8.  TASM.DOC          - TASM Documentation
  3235.             9.  README            - Brief Explanation of Disk contents
  3236.             10. ORDER.FRM         - Order Form
  3237.             11. COPYRIGH.T        - Copyright notice
  3238.  
  3239.             12. TASM.C            - TASM mainline source code
  3240.             13. MACRO.C           - Macro expander and other functions
  3241.             14. TASM.H            - Header file defining TASM constants
  3242.             15. TASM.MAK          - Make file for building TASM
  3243.  
  3244.     The  'C'  modules  can  be compiled with the Microsoft 'C' compiler,
  3245.     version 5.0   using  the  small  memory  model.  It  should  not  be
  3246.     difficult  to use other 'C'   compilers.   See section on  'BUILDING
  3247.     TASM  FROM  THE SOURCE CODE'   for  more   information   on    using
  3248.     other compilers.
  3249.  
  3250.  
  3251.     TASM - Table Driven Assembler Version 2.7                    Page 72
  3252.  
  3253.  
  3254.     BUILDING TASM FROM THE SOURCE CODE
  3255.  
  3256.     TASM  can  be built using the provided 'make'  file,  assuming   the
  3257.     Microsoft C compiler (version 5.0) is available.  The can be done as
  3258.     follows:
  3259.  
  3260.             make tasm.mak
  3261.  
  3262.  
  3263.     For UNIX, try this:
  3264.  
  3265.             %cc -DUNIX tasm.c macro.c  -o tasm
  3266.  
  3267.     The header file tasm.h should also be available.
  3268.  
  3269.     Note  that the UNIX flag is being defined on the command line.  This
  3270.     causes the following things to happen:
  3271.  
  3272.             1.  Tasm.h includes somewhat different system include files
  3273.                     appropriate for the UNIX environment.
  3274.  
  3275.             2.  TASM declares a 64 Kbyte array  in  which  to  hold  the
  3276.                     assembled    opcodes    and    data  in  a  slightly
  3277.                     different way.   MS C must use the 'far' keyword for
  3278.                     such  an  array  to give it a segment  all  its  own
  3279.                     (assuming use of the small memory model).  Most UNIX
  3280.                     environments do not have need for such syntax.
  3281.  
  3282.  
  3283.     TASM - Table Driven Assembler Version 2.7                    Page 73
  3284.  
  3285.  
  3286.     TASM INSTRUCTION SET TABLE DEFINITION
  3287.  
  3288.     The tables that control TASM's interpretation of the source file are
  3289.     read from a file at run time.  The table file name is determined  by
  3290.     taking  the  numeric option field specified on the TASM command line
  3291.     and appending it to the string "TASM", then a  ".TAB"  extension  is
  3292.     added.  Thus, if the following command line is entered:
  3293.  
  3294.             tasm -51  test.asm
  3295.  
  3296.     then TASM would read the table file named "TASM51.TAB".
  3297.  
  3298.  
  3299.     The following rules apply to the structure of the table file:
  3300.  
  3301.             1.  The  first  line  of  the  file  should contain a string
  3302.                     surrounded by double quotes that should identify the
  3303.                     version of the assembler  table.  This  string  will
  3304.                     appear at the top of each page in the list file.  It
  3305.                     should be limited to 24 characters.
  3306.             2.  Any line that starts with a '.' is considered a directive.
  3307.                     The following directives are available:
  3308.  
  3309.                     DIRECTIVE       MEANING
  3310.                     ----------------------------------------------------
  3311.                     MSFIRST         Generate opcodes MS byte first.
  3312.                     ALTWILD         Use '@' instead of '*' as the
  3313.                                     wild card in the table.
  3314.  
  3315.             3.  Any   line  whose  first  character  is not a '.' and is
  3316.                     not  alphabetic is considered to be a comment and is
  3317.                     discarded.
  3318.  
  3319.             4.  Any  line  that has an alphabetic character as the first
  3320.                     character is assumed to be an instruction definition
  3321.                     record  and  is  parsed  to   build   the   internal
  3322.                     representation   of   the  instruction  set  tables.
  3323.                     Eight  fields   (separated  by  white  space)    are
  3324.                     expected,  as follows:
  3325.  
  3326.  
  3327.     TASM - Table Driven Assembler Version 2.7                    Page 74
  3328.  
  3329.                     Field Name      Description
  3330.                     --------------------------------------------
  3331.                     INSTRUCTION     Instruction Mnemonic
  3332.                     ARGS            Argument definition
  3333.                     OPCODE          Opcode value
  3334.                     NBYTES          Number of bytes
  3335.                     MODOP           Modifier operation
  3336.                     CLASS           Instruction class
  3337.                     SHIFT           Argument left shift count
  3338.                     OR              Argument bitwise OR mask
  3339.  
  3340.                     INSTRUCTION.  The  INSTRUCTION  field should contain
  3341.                     the string to be  used  as  the  mnemonic  for  this
  3342.                     instruction.  Upper case letters should be used (the
  3343.                     source statements are converted to upper case before
  3344.                     comparison).
  3345.  
  3346.  
  3347.                     ARGS.   The  ARGS  field  should  contain  a  string
  3348.                     describing  the  format  of  the operand field.  All
  3349.                     characters are taken literally except the '*'  which
  3350.                     denotes  the  presence  of  a valid TASM expression.
  3351.                     Multiple '*'s can be used,  but all but the last one
  3352.                     must  be  followed  by  a  comma.  If  a  single '*'
  3353.                     appears in the ARGS field,  then the default  action
  3354.                     of  TASM  will  be  to  determine  the  value of the
  3355.                     expression that matches the field and insert one  or
  3356.                     two  bytes  of  it into the object file depending on
  3357.                     the NBYTES field.  If multiple '*'s are  used,  then
  3358.                     special  operators  (MODOP)  must  be  used  to take
  3359.                     advantage of them (see the examples below).  An ARGS
  3360.                     field of a pair  of  double  quotes  means  that  no
  3361.                     arguments are expected.
  3362.  
  3363.  
  3364.                     OPCODE.  The OPCODE field should contain the  opcode
  3365.                     value    (two  to  six  hex   digits)   for   this
  3366.                     instruction  and  address mode.   Each pair  of  hex
  3367.                     digits  represent  a  single  byte  of  the  opcode,
  3368.                     ordered with the right most pair being placed in the
  3369.                     lowest memory location.
  3370.  
  3371.  
  3372.                     NBYTES.  The NBYTES field should specify the  number
  3373.                     of  bytes  this  instruction  is to occupy (a single
  3374.                     decimal  digit).   This number includes both  opcode
  3375.                     bytes and argument bytes, thus,  the number of bytes
  3376.  
  3377.     TASM - Table Driven Assembler Version 2.7                    Page 75
  3378.  
  3379.                     of argument is computed by subtracting the number of
  3380.                     bytes  of  opcode  (dictated by the  length  of  the
  3381.                     OPCODE field) from NBYTES.
  3382.  
  3383.  
  3384.                     MODOP.  The MODOP field determines  if  any  special
  3385.                     operations   need   to  be  performed  on  the  code
  3386.                     generated for this  instruction.  For  example,  the
  3387.                     zero-page  addressing  mode of the 6502 is a special
  3388.                     case of the absolute addressing mode, and is handled
  3389.                     by a special MODOP code (see appendix B).  The  list
  3390.                     of operators is as follows:
  3391.  
  3392.  
  3393.                     MODOP       DESCRIPTION
  3394.                     ---------------------------------------------------
  3395.                     NOTOUCH     Do nothing to instruction or args
  3396.                     JMPPAGE     Put bits 8-10 of first arg into
  3397.                                 bits 5-7 of opcode (8048 JMP)
  3398.                     ZPAGE       If arg < 256 then use zero-page (6502)
  3399.                     R1          Make arg relative to PC (single byte)
  3400.                     R2          Make arg relative to PC (two byte)
  3401.                     CREL        Combine LS bytes of first two args
  3402.                                 making the second one relative to PC
  3403.                     SWAP        Swap bytes of first arg
  3404.                     COMBINE     Combine LS bytes of first two args into
  3405.                                 first arg (arg1 -> LSB, arg2 ->MSB).
  3406.                     CSWAP       Combine LS bytes of first two args into
  3407.                                 first arg and swap.
  3408.                     ZBIT        Z80 bit instructions.
  3409.                     MBIT        Motorola (6805) bit instructions
  3410.                     MZERO       Motorola (6805) zero page (direct)
  3411.                     3ARG        Three args, one byte each.
  3412.                     3REL        Three args, one byte each, last one
  3413.                                 relative
  3414.                     T1          TMS320 instruction with one arg.  Shift
  3415.                                 according to SHIFT and mask with OR and
  3416.                                 OR into opcode.  If a second arg exists
  3417.                                 assume it is an <arp> and OR into   LSB
  3418.                                 of opcode.
  3419.                     TDMA        TMS320 instruction with first arg <dma>.
  3420.                                 Second arg gets shift/and/or  treatment
  3421.                                 as with T1.
  3422.                     TAR         TMS320 instruction with first arg <ar>.
  3423.                                 Second arg gets shift/and/or  treatment
  3424.                                 as with T1.
  3425.  
  3426.  
  3427.     TASM - Table Driven Assembler Version 2.7                    Page 76
  3428.  
  3429.                     Note  that the reason for the combining of arguments
  3430.                     (COMBINE and CSWAP) is that TASM  assumes  that  all
  3431.                     object  bytes  to be inserted in the object file are
  3432.                     derived from a variable representing  the  value  of
  3433.                     the  first  argument (argval).  If two arguments are
  3434.                     in the  ARGS  field,  then  one  of  the  previously
  3435.                     mentioned  MODOP`s  must  be  used.  They  have  the
  3436.                     effect of combining the low bytes of the  first  two
  3437.                     arguments  into the variable (argval) from which the
  3438.                     object  code  will  be  generated.  TASM`s  argument
  3439.                     parsing   routine  can  handle  a  large  number  of
  3440.                     arguments,  but the code that generates  the  object
  3441.                     code is less capable.
  3442.  
  3443.                     CLASS.  The  CLASS  field is used to specify whether
  3444.                     this instruction is part of the standard instruction
  3445.                     set or a member of a set of  extended  instructions.
  3446.                     Bit 0 of this field should be set to denote a member
  3447.                     of  the standard instruction set.  Other bits can be
  3448.                     used as needed  to  establish  several  classes  (or
  3449.                     sets)   of  instructions  that  can  be  enabled  or
  3450.                     disabled via  the  '-x'  command  line  option  (see
  3451.                     section on 6502 INSTRUCTIONS AND ADDRESSING MODES).
  3452.  
  3453.                     SHIFT (optional).   The SHIFT field is used to cause
  3454.                     the  first  argument of the given instruction to  be
  3455.                     shifted left the specified number of bits.   (Except
  3456.                     T1, TDMA, TAR MODOPS as noted below).
  3457.  
  3458.                     OR  (optional).   The OR field is used to perform  a
  3459.                     bitwise  OR  with  the first argument of  the  given
  3460.                     instruction.  Specified as hex digits.  (Except  T1,
  3461.                     TDMA, TAR MODOPS as noted below).
  3462.  
  3463.     Note that the SHIFT/OR fields are used somewhat differently for  T1,
  3464.     TDMA,  and TAR MODOPS.  In those cases,  the SHIFT and OR fields are
  3465.     used  but the OR field is really an AND mask and the result is  OR'd
  3466.     with the opcode.
  3467.  
  3468.     The   following  table   shows   possible    instruction  definition
  3469.     records,  followed  by  possible  source statements that would match
  3470.     it,    followed by the resulting object code that would be generated
  3471.     (in hex):
  3472.  
  3473.     TASM - Table Driven Assembler Version 2.7                    Page 77
  3474.  
  3475.                                               EXAMPLE         EXAMPLE
  3476.     INSTRUCTION DEFINITION                    SOURCE          OBJECT
  3477.     -------------------------------------------------------------------
  3478.     XYZ  *      FF   3  NOTOUCH 1             xyz 1234h       FF 34 12
  3479.     XYZ  *      FF   2  NOTOUCH 1             xyz 1234h       FF 34
  3480.     ZYX  *      FE   3  SWAP    1             zyx 1234h       FE 12 34
  3481.     ZYX  *      FE   3  R2      1             zyx $+4         FE 01 00
  3482.     ABC  *,*    FD   3  COMBINE 1             abc 45h,67h     FD 45 67
  3483.     ABC  *,*    FD   3  CSWAP   1             abc 45h,67h     FD 67 45
  3484.     ADD  A,#*   FC   2  NOTOUCH 1             add A,#'B'      FC 42
  3485.     RET  ""     FB   1  NOTOUCH 1             ret             FB
  3486.     LD   IX,*   21DD 4  NOTOUCH 1             ld  IX,1234h    DD 21 34 12
  3487.     LD   IX,*   21DD 4  NOTOUCH 1 1 0         ld  IX,1234h    DD 21 68 24
  3488.     LD   IX,*   21DD 4  NOTOUCH 1 0 1         ld  IX,1234h    DD 21 35 12
  3489.     LD   IX,*   21DD 4  NOTOUCH 1 1 1         ld  IX,1234h    DD 21 69 24
  3490.     LD   IX,*   21DD 4  NOTOUCH 1 8 12        ld  IX,34h      DD 21 12 34
  3491.  
  3492.     See Appendix B for more examples.
  3493.  
  3494.     The  order  of  the  entries for various addressing modes of a given
  3495.     instruction is important.  Since the wild card matches anything,  it
  3496.     is  important to specify the ARGS for the addressing modes that have
  3497.     the  most  qualifying  characters  first.   For   example,   if   an
  3498.     instruction  had  two  addressing  modes,   one  that  accepted  any
  3499.     expression,  and another that required a pound sign in front  of  an
  3500.     expression,  the  pound  sign  entry  should  go first otherwise all
  3501.     occurrences of the instruction would match  the  more  general  ARGS
  3502.     expression   that  it  encountered  first.   The  following  entries
  3503.     illustrate the proper sequencing:
  3504.  
  3505.             ADD #*  12 3 NOTOUCH 1
  3506.             ADD *   13 3 NOTOUCH 1
  3507.  
  3508.  
  3509.     TASM - Table Driven Assembler Version 2.7                    Page 78
  3510.  
  3511.  
  3512.     APPENDIX A - SAMPLE LISTING FILE
  3513.  
  3514.     The listing was generated by issuing the command:
  3515.             tasm -65 -p -l -h -f00 t.asm
  3516.  
  3517.     TASM 6502 Assembler.            t.asm                         page 1
  3518.     Speech Technology Incorporated.
  3519.  
  3520.     0001   0000             ;This is a simple example of an assembly
  3521.     0002   0000             ;include a file just for fun
  3522.     0003   0000             #include        "include.h"
  3523.     0001+  0000             ;this is just a simple include file
  3524.     0002+  0000             exit    .equ    7e00h
  3525.     0003+  0000             ;
  3526.     0004+  0000             ; That's all
  3527.     0004   0000             ;
  3528.     0005   0000             ; define two byte increment macro
  3529.     0006   0000             #define INCZ(p) ldx #p\ inc 0,x\ bne $+4\ inc 1,x
  3530.     0007   0000             ;
  3531.     0008   0000             start   .org    $0
  3532.     0009   0000             mask    .equ    $5678
  3533.     0010   0000
  3534.     0011   0000 0A          byte1   .byte   10
  3535.     0012   0001 D2 04       word1   .word   1234
  3536.     0013   0003 34 12       word2   .word   $1234
  3537.     0014   0005             ;skip past a few locations to start code
  3538.     0015   0020                     .org    $0020
  3539.     0016   0020             begin
  3540.     0017   0020             ;     let's just increment word1 the number
  3541.     0018   0020             ;     of times indicated by byte1 (use the
  3542.     0019   0020             ;     double byte increment macro INCZ).
  3543.     0020   0020             loop1
  3544.     0021   0020 A2 01               ldx #word1\ inc 0,x\ bne $+4\ inc 1,x
  3545.     0021   0022 F6 00
  3546.     0021   0024 D0 02
  3547.     0021   0026 F6 01
  3548.     0022   0028 C6 00               dec     byte1   ;decrement the count
  3549.     0023   002A D0 F4               bne     loop1   ;loop until zero
  3550.     0024   002C
  3551.     0025   002C             ; Now  let's just do some simple arithmetic
  3552.     0026   002C A5 56               lda     (mask >> 8)
  3553.     0027   002E AD 00 56            lda     (mask & 0ff00h)
  3554.     0028   0031 A5 57               lda     ((mask >> 8) & 0ffh) + word1
  3555.     0029   0033 4C 00 7E            jmp     exit
  3556.     0030   0036                     .end
  3557.  
  3558.     TASM - Table Driven Assembler Version 2.7                    Page 79
  3559.  
  3560.  
  3561.  
  3562.     Label        Value      Label        Value      Label        Value
  3563.     ------------------      ------------------      ------------------
  3564.     exit          7E00      start         0000      mask          5678
  3565.     byte1         0000      word1         0001      word2         0003
  3566.     begin         0020      loop1         0020
  3567.  
  3568.     ADDR  00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
  3569.     -----------------------------------------------------
  3570.     0000  0A D2 04 34 12 00 00 00 00 00 00 00 00 00 00 00
  3571.     0010  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  3572.     0020  A2 01 F6 00 D0 02 F6 01 C6 00 D0 F4 A5 56 AD 00
  3573.     0030  56 A5 57 4C 00 7E 00 00 00 00 00 00 00 00 00 00
  3574.  
  3575.     tasm: Number of errors = 0
  3576.  
  3577.  
  3578.     TASM - Table Driven Assembler Version 2.7                    Page 80
  3579.  
  3580.  
  3581.     APPENDIX B - SAMPLE INSTRUCTION DEFINITION TABLE (TASM65.TAB)
  3582.  
  3583.     "TASM 6502 Assembler.    "
  3584.     /* This is the instruction set definition table
  3585.     /*   for the 6502 version of TASM.
  3586.     /*      Thomas N. Anderson, Speech Technology Incorporated, Feb 1986.
  3587.     /*  First line of this file is a banner that will appear at the
  3588.     /*  top of each page of the TASM listing file (not the same as
  3589.     /*  the TITLE).  Should be limited to 24 characters.
  3590.     /*  Any other line that does not start with an upper case letter is
  3591.     /*  ignored.
  3592.     /*  See TASM manual for info on table structure.
  3593.     /*  Note that there are two classes of extended instructions beyond
  3594.     /*    the standard set.  The classes are assigned bits as follows:
  3595.     /*      bit 0 = standard set
  3596.     /*      bit 1 = extended instructions for R65C02
  3597.     /*      bit 2 = extended instructions for R65C00/21
  3598.     /*
  3599.     /*INSTR ARGS OPCODE BYTES MOD CLASS SHIFT OR */
  3600.     /*-------------------------------------------*/
  3601.     ADC  #*     69    2  NOP 1
  3602.     ADC  (*,X)  61    2  NOP 1
  3603.     ADC  (*),Y  71    2  NOP 1
  3604.     ADC  (*)    72    2  NOP 2   /* R65C02 */
  3605.     ADC  *,X    7D    3  ZP  1
  3606.     ADC  *,Y    79    3  NOP 1
  3607.     ADC  *      6D    3  ZP  1
  3608.  
  3609.     AND  #*     29    2  NOP 1
  3610.     AND  (*,X)  21    2  NOP 1
  3611.     AND  (*),Y  31    2  NOP 1
  3612.     AND  (*)    32    2  NOP 2   /* R65C02 */
  3613.     AND  *,X    3D    3  ZP  1
  3614.     AND  *,Y    39    3  NOP 1
  3615.     AND  *      2D    3  ZP  1
  3616.  
  3617.     ASL  A      0A    1  NOP 1
  3618.     ASL  *,X    1E    3  ZP  1
  3619.     ASL  *      0E    3  ZP  1
  3620.  
  3621.     BCC  *      90    2  R1  1
  3622.     BCS  *      B0    2  R1  1
  3623.     BEQ  *      F0    2  R1  1
  3624.     BNE  *      D0    2  R1  1
  3625.     BMI  *      30    2  R1  1
  3626.     BPL  *      10    2  R1  1
  3627.  
  3628.     TASM - Table Driven Assembler Version 2.7                    Page 81
  3629.  
  3630.     BVC  *      50    2  R1  1
  3631.     BVS  *      70    2  R1  1
  3632.  
  3633.     BIT  #*     89    2  NOP 2
  3634.     BIT  *,X    3C    3  ZP  2
  3635.     BIT  *      2C    3  ZP  1
  3636.  
  3637.     BRK  ""     00    1  NOP 1
  3638.  
  3639.     CLC  ""     18    1  NOP 1
  3640.     CLD  ""     D8    1  NOP 1
  3641.     CLI  ""     58    1  NOP 1
  3642.     CLV  ""     B8    1  NOP 1
  3643.     CMP  #*     C9    2  NOP 1
  3644.     CMP  (*,X)  C1    2  NOP 1
  3645.     CMP  (*),Y  D1    2  NOP 1
  3646.     CMP  (*)    D2    2  NOP 2
  3647.     CMP  *,X    DD    3  ZP  1
  3648.     CMP  *,Y    D9    3  NOP 1
  3649.     CMP  *      CD    3  ZP  1
  3650.  
  3651.     CPX  #*     E0    2  NOP 1
  3652.     CPX  *      EC    3  ZP  1
  3653.     CPY  #*     C0    2  NOP 1
  3654.     CPY  *      CC    3  ZP  1
  3655.  
  3656.     DEC  A      3A    3  NOP 2
  3657.     DEC  *,X    DE    3  ZP  1
  3658.     DEC  *      CE    3  ZP  1
  3659.  
  3660.     DEX  ""     CA    1  NOP 1
  3661.     DEY  ""     88    1  NOP 1
  3662.  
  3663.     EOR  #*     49    2  NOP 1
  3664.     EOR  (*,X)  41    2  NOP 1
  3665.     EOR  (*),Y  51    2  NOP 1
  3666.     EOR  (*)    52    2  NOP 2
  3667.     EOR  *,X    5D    3  ZP  1
  3668.     EOR  *,Y    59    3  NOP 1
  3669.     EOR  *      4D    3  ZP  1
  3670.  
  3671.     INC  A      1A    3  NOP 2
  3672.     INC  *,X    FE    3  ZP  1
  3673.     INC  *      EE    3  ZP  1
  3674.  
  3675.     INX  ""     E8    1  NOP 1
  3676.     INY  ""     C8    1  NOP 1
  3677.  
  3678.     TASM - Table Driven Assembler Version 2.7                    Page 82
  3679.  
  3680.  
  3681.     JMP  (*,X)  7C    3  NOP 2
  3682.     JMP  (*)    6C    3  NOP 1
  3683.     JMP  *      4C    3  NOP 1
  3684.  
  3685.     JSR  *      20    3  NOP 1
  3686.  
  3687.     LDA  #*     A9    2  NOP 1
  3688.     LDA  (*,X)  A1    2  NOP 1
  3689.     LDA  (*),Y  B1    2  NOP 1
  3690.     LDA  (*)    B2    2  NOP 2
  3691.     LDA  *,X    BD    3  ZP  1
  3692.     LDA  *,Y    B9    3  NOP 1
  3693.     LDA  *      AD    3  ZP  1
  3694.  
  3695.     LDX  #*     A2    2  NOP 1
  3696.     LDX  *,Y    BE    3  ZP  1
  3697.     LDX  *      AE    3  ZP  1
  3698.  
  3699.     LDY  #*     A0    2  NOP 1
  3700.     LDY  *,X    BC    3  ZP  1
  3701.     LDY  *      AC    3  ZP  1
  3702.  
  3703.     LSR  A      4A    1  NOP 1
  3704.     LSR  *,X    5E    3  ZP  1
  3705.     LSR  *      4E    3  ZP  1
  3706.  
  3707.     NOP  ""     EA    1  NOP 1
  3708.  
  3709.     ORA  #*     09    2  NOP 1
  3710.     ORA  (*,X)  01    2  NOP 1
  3711.     ORA  (*),Y  11    2  NOP 1
  3712.     ORA  (*)    12    2  NOP 2
  3713.     ORA  *,X    1D    3  ZP  1
  3714.     ORA  *,Y    19    3  NOP 1
  3715.     ORA  *      0D    3  ZP  1
  3716.  
  3717.     PHA  ""     48    1  NOP 1
  3718.     PHP  ""     08    1  NOP 1
  3719.     PLA  ""     68    1  NOP 1
  3720.     PLP  ""     28    1  NOP 1
  3721.  
  3722.     ROL  A      2A    1  NOP 1
  3723.     ROL  *,X    3E    3  ZP  1
  3724.     ROL  *      2E    3  ZP  1
  3725.  
  3726.     ROR  A      6A    1  NOP 1
  3727.  
  3728.     TASM - Table Driven Assembler Version 2.7                    Page 83
  3729.  
  3730.     ROR  *,X    7E    3  ZP  1
  3731.     ROR  *      6E    3  ZP  1
  3732.  
  3733.     RTI  ""     40    1  NOP 1
  3734.     RTS  ""     60    1  NOP 1
  3735.  
  3736.     SBC  #*     E9    2  NOP 1
  3737.     SBC  (*,X)  E1    2  NOP 1
  3738.     SBC  (*),Y  F1    2  NOP 1
  3739.     SBC  (*)    F2    2  NOP 2
  3740.     SBC  *,X    FD    3  ZP  1
  3741.     SBC  *,Y    F9    3  NOP 1
  3742.     SBC  *      ED    3  ZP  1
  3743.  
  3744.     SEC  ""     38    1  NOP 1
  3745.     SED  ""     F8    1  NOP 1
  3746.     SEI  ""     78    1  NOP 1
  3747.  
  3748.     STA  (*,X)  81    2  NOP 1
  3749.     STA  (*),Y  91    2  NOP 1
  3750.     STA  (*)    92    2  NOP 2
  3751.     STA  *,X    9D    3  ZP  1
  3752.     STA  *,Y    99    3  NOP 1
  3753.     STA  *      8D    3  ZP  1
  3754.  
  3755.     STX  *,Y    96    2  ZP  1
  3756.     STX  *      8E    3  ZP  1
  3757.  
  3758.     STY  *,X    94    2  NOP 1
  3759.     STY  *      8C    3  ZP  1
  3760.  
  3761.     TAX  ""     AA    1  NOP 1
  3762.     TAY  ""     A8    1  NOP 1
  3763.     TSX  ""     BA    1  NOP 1
  3764.     TXA  ""     8A    1  NOP 1
  3765.     TXS  ""     9A    1  NOP 1
  3766.     TYA  ""     98    1  NOP 1
  3767.  
  3768.     /* Here are the extended instructions that are totally new */
  3769.  
  3770.     BRA  *      80    2  R1  6
  3771.  
  3772.     BBR0 *,*    0f    3  CR  6
  3773.     BBR1 *,*    1f    3  CR  6
  3774.     BBR2 *,*    2f    3  CR  6
  3775.     BBR3 *,*    3f    3  CR  6
  3776.     BBR4 *,*    4f    3  CR  6
  3777.  
  3778.     TASM - Table Driven Assembler Version 2.7                    Page 84
  3779.  
  3780.     BBR5 *,*    5f    3  CR  6
  3781.     BBR6 *,*    6f    3  CR  6
  3782.     BBR7 *,*    7f    3  CR  6
  3783.  
  3784.     BBS0 *,*    8f    3  CR  6
  3785.     BBS1 *,*    9f    3  CR  6
  3786.     BBS2 *,*    af    3  CR  6
  3787.     BBS3 *,*    bf    3  CR  6
  3788.     BBS4 *,*    cf    3  CR  6
  3789.     BBS5 *,*    df    3  CR  6
  3790.     BBS6 *,*    ef    3  CR  6
  3791.     BBS7 *,*    ff    3  CR  6
  3792.  
  3793.     MUL  ""     02    1  NOP 4  /* R65C00/21 only*/
  3794.  
  3795.     PHX  ""     da    1  NOP 6
  3796.     PHY  ""     5a    1  NOP 6
  3797.     PLX  ""     fa    1  NOP 6
  3798.     PLY  ""     7a    1  NOP 6
  3799.  
  3800.     RMB0 *      07    2  NOP 6
  3801.     RMB1 *      17    2  NOP 6
  3802.     RMB2 *      27    2  NOP 6
  3803.     RMB3 *      37    2  NOP 6
  3804.     RMB4 *      47    2  NOP 6
  3805.     RMB5 *      57    2  NOP 6
  3806.     RMB6 *      67    2  NOP 6
  3807.     RMB7 *      77    2  NOP 6
  3808.  
  3809.     SMB0 *      87    2  NOP 6
  3810.     SMB1 *      97    2  NOP 6
  3811.     SMB2 *      a7    2  NOP 6
  3812.     SMB3 *      b7    2  NOP 6
  3813.     SMB4 *      c7    2  NOP 6
  3814.     SMB5 *      d7    2  NOP 6
  3815.     SMB6 *      e7    2  NOP 6
  3816.     SMB7 *      f7    2  NOP 6
  3817.  
  3818.     /* The following extended instructions are available on the
  3819.             R65C02 but not the R65C00/21 */
  3820.  
  3821.     STZ  *,X    9e    3  ZP  2
  3822.     STZ  *      9c    3  ZP  2
  3823.  
  3824.     TRB  *      1c    3  ZP  2
  3825.     TSB  *      0c    3  ZP  2
  3826.  
  3827.  
  3828.     TASM - Table Driven Assembler Version 2.7                    Page 85
  3829.  
  3830.  
  3831.     APPENDIX C - ORDERING INFORMATION
  3832.  
  3833.     TASM    is  distributed as shareware.    The shareware  portion   of
  3834.     the  product may be freely copied and used for evaluation  purposes.
  3835.     Use  of   TASM  beyond  a  reasonable  evaluation  period   requires
  3836.     registration. Registered  users  receive the following benefits:
  3837.  
  3838.             1.  The recent version of TASM.
  3839.             2.  TASM source code (in C).
  3840.             3.  Bound TASM manual.
  3841.             4.  Telephone support.
  3842.             5.  Knowledge that they are supporting  the  development  of
  3843.                     useful but inexpensive software.
  3844.  
  3845.     DESCRIPTION                             UNIT PRICE            PRICE
  3846.     --------------------------------------------------------------------
  3847.     TASM Registration (TASM, manual, & source)  $30.00           _______
  3848.  
  3849.     TASM User's Manual (included above)          10.00           _______
  3850.  
  3851.     TASM update for registered users             10.00           _______
  3852.        (latest source, executable, and manual)
  3853.  
  3854.     TASM shareware disk                          10.00           _______
  3855.  
  3856.     Subtotal                                                     _______
  3857.  
  3858.     Tax (Washington state residents add 8.1%)                    _______
  3859.  
  3860.     Foreign postage (outside North America) add $10.00           _______
  3861.       (Foreign orders must be in US funds drawn on a US bank).
  3862.  
  3863.     TOTAL (post paid)                                            _______
  3864.  
  3865.     Shipping Address: __________________________________________________
  3866.  
  3867.                       __________________________________________________
  3868.  
  3869.                       __________________________________________________
  3870.  
  3871.     Send check or money order (no credit cards) to: Speech Technology Inc.
  3872.                                                     Software Division
  3873.                                                     837 Front Street South
  3874.                                                     Issaquah,  WA  98027
  3875.  
  3876.  
  3877.  
  3878.