home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / archives / appleii.zip / appxas.1 < prev    next >
Text File  |  1990-12-05  |  23KB  |  759 lines

  1. #!/bin/sh
  2. # This is a shell archive, meaning:
  3. # 1. Remove everything above the #!/bin/sh line.
  4. # 2. Save the resulting text in a file.
  5. # 3. Execute the file with /bin/sh (not csh) to create the files:
  6. #    assmtest
  7. #    assmtest.l
  8. #    makefile
  9. #    user.nr
  10. # This archive created: Tue Apr  2 14:21:42 1985
  11. # By:    James Van Ornum (AT&T-Bell Laboratories)
  12. export PATH; PATH=/bin:$PATH
  13. if test -f 'assmtest'
  14. then
  15.     echo shar: over-writing existing file "'assmtest'"
  16. fi
  17. cat << \SHAR_EOF > 'assmtest'
  18. ;******************************************
  19. ; Test file for the 65c02 assembler - as65c02
  20. ; assemble as
  21. ;     as65c02 -nisv assmtest
  22. ; and compare output with assmtest.l
  23. ;******************************************
  24. ;; comment treatment
  25. ;******************************************
  26. aa = $10; ';' immediately after the '0'
  27. B = $20 space to comment subfield
  28. C = $30    tab to comment subfield
  29. DEFGHIjkl = $FFEE
  30. D =DEFGHIjkl
  31. ;******************************************
  32. ; Number formats
  33. ;******************************************
  34. start *= $4 ; location counter adjust
  35.  .byte %0101 ; binary number
  36.  .byte 022,@22,^o22 ; octal numbers - three forms
  37.  .byte 22 ; decimal number
  38.  .byte $22,$ff,$FF ; hex - upper/lower case
  39.  .byte 'a,'b ; single ASCII characters
  40. ;******************************************
  41. ;; ASCII character string
  42. ;******************************************
  43.  .byte "abcd\t\n",0 ;   tab and new line escaped
  44. ;******************************************
  45. ; Operation checks
  46. ;******************************************
  47.  .word aa+B ; addition
  48.  .word aa-B ; subtraction
  49.  .word aa*B ; multiplication
  50.  .word B/aa ; division
  51.  .word C%B ; modulo
  52.  .word B!C ; exclusive OR
  53.  .word ~C ; one's complement
  54.  .word B&C ; logical AND
  55.  .word aa|B ; logical OR
  56.  .word D\ ; low byte
  57.  .word D^ ; high byte
  58.  .word * ; current location
  59.  .word aa,B,C
  60.  .word B*<aa+C> ; one level of parenthesis
  61.  .dbyt D ; high byte-low byte word
  62.  .word D/256,D%256
  63. ;******************************************
  64. ; Addressing Mode Check
  65. ;******************************************
  66.  *=$0100
  67.  lda =aa ; immediate addressing
  68.  lda #aa ; immediate addressing, alternate
  69.  lda D ; direct addessing
  70.  LDA aa ; page zero addressing, aa < 256
  71. a1 = 512
  72. a2 = 500
  73.  lda a1-a2 ; also page zero
  74.  asl A ; accumulator addressing
  75.  AsL a ; accumulator addressing also
  76.  brk ; implied addressing
  77.  lda (aa,X) ; indirect,X addressing
  78.  lda (aa),Y ; indirect,Y addressing
  79.  lda aa,X ; zero page,X addressing
  80.  lda D,X ; absolute,X addressing
  81.  lda D,Y ; absolute,Y addressing
  82.  bcc *-$10 ; relative addressing
  83.  jmp (D) ; indirect addressing
  84.     jmp    (a2,x)    ; abs indexed indirect
  85.     adc    (aa)        ; indirect zero page
  86.  ldx aa,Y ; zero page,Y addressing
  87.  ldx aa,y ; alternate index name
  88.  .nlst
  89. ;******************************************
  90. ; opcode check
  91. ;******************************************
  92.  adc =01
  93.  and =01
  94.     and    (aa)
  95.  asl A
  96.  bcc *+2
  97.  bcs *+2
  98.  beq *+2
  99.  bit $01
  100.     bit $301,x
  101.     bit    $01,x
  102.  bmi *+2
  103.  bne *+2
  104.  bpl *+2
  105.     bra *+2
  106.  brk
  107.  bvc *+2
  108.  bvs *+2
  109.  clc
  110.  cld
  111.  cli
  112.  clv
  113.  cmp =01
  114.     cmp    (aa)
  115.  cpx =01
  116.  cpy =01
  117.     dea
  118.  dec $01
  119.  dex
  120.  dey
  121.  eor =01
  122.     eor    (aa)
  123.     ina
  124.  inc $01
  125.  inx
  126.  iny
  127.  jmp *+3
  128.  jsr *+3
  129.  lda =01
  130.     lda    (aa)
  131.  ldx =01
  132.  ldy =01
  133.  lsr A
  134.  nop
  135.  ora =01
  136.     ora    (aa)
  137.  pha
  138.  php
  139.     phx
  140.     phy
  141.  pla
  142.  plp
  143.     plx
  144.     ply
  145.  rol A
  146.  ror A
  147.  rti
  148.  rts
  149.  sbc =01
  150.     sbc    (aa)
  151.  sec
  152.  sed
  153.  sei
  154.  sta $01
  155.     sta    (aa)
  156.  stx $01
  157.  sty $01
  158.     stz    $301
  159.     stz    $301,x
  160.     stz    $01
  161.     stz    $01,x
  162.  tax
  163.  tay
  164.     trb    $301
  165.     trb    $01
  166.     tsb    $301
  167.     tsb    $01
  168.  tsx
  169.  txa
  170.  txs
  171.  tya
  172. .title    some     way for a listing
  173. .sbttl check for .ifeq
  174.     .ifeq    0
  175.     .byte    1,2,3,$34,@10
  176.     .endc
  177.     .ifne    0
  178.     .word    1234,$4354,@7777
  179.     .endc
  180. ; now check nesting
  181.     .ifeq    0
  182.     lda    .
  183.     .ifne    0
  184. m2    .asciz    /help/
  185.     .endc
  186. m3    nasc    <more of same>
  187.     .endc
  188.     msb    ON
  189.     .asciz    /high order bits on /
  190.     nasc    <should not be affected>    1
  191.     msb    off
  192.     .asciz    /high order bits off/
  193.     nasc    <still not affected>     0
  194. m31    org    *+2
  195. m4    .word    .+34
  196. m41    org    .+2
  197. m5    .byte    
  198. ;    now lets try some blank lines
  199.     .asciz    /this is ok?/
  200.  
  201.     nasc    <how about this>
  202.  
  203.     .byte    0,$e
  204.  
  205.  
  206.     .word    2    ;how about two in a row
  207. .title what does the control l mean
  208. .sbttl perhaps is the Dec 20 way of new page, anyway ignore it
  209.     .ifeq    1
  210. .sbttl Lets check to see if we skip
  211.     .asciz    /this should not assemble/
  212. .sbttl these lines
  213.     .endc
  214. .sbttl    now this is the living end
  215. aaaa    equ    aa+3
  216. aaa    equ    abc+5
  217.     .byte    3
  218. abc    nasc    <the end>
  219.     .byte    255
  220.     org    $100
  221.     .asciz /1/
  222.     jmp    d
  223.     jmp    d+2
  224.     lda    cba
  225.     lda    abc-4
  226.     .byte    3
  227.     nasc <1>
  228.     nasc <22> 1
  229. baaa    =    7+d    ; can you handle this
  230.     nasc <three> 0
  231. d    lda    #4
  232. cba    .word    2345
  233. bbc
  234.     ldx    d+3^
  235.     lda    cba
  236.     lda    baaa
  237.     jmp    bbc
  238.     lda     #3
  239. rep    lda    #23
  240.     org    $fe
  241.     .ifeq    <.\-$ff>    ;what does the loc counter say
  242.     nop
  243.     .endc
  244.     .ifeq    <.\-$fe>    ; loc ctr
  245.     nop
  246.     nop
  247.     .endc
  248. SHAR_EOF
  249. if test -f 'assmtest.l'
  250. then
  251.     echo shar: over-writing existing file "'assmtest.l'"
  252. fi
  253. cat << \SHAR_EOF > 'assmtest.l'
  254. as65c02 - version 4.1b - 11/22/84 - JHV [gvw]
  255.    1                   ;******************************************
  256.    2                   ; Test file for the 65c02 assembler - as65c02
  257.    3                   ; assemble as
  258.    4                   ;     as65c02 -nisv assmtest
  259.    5                   ; and compare output with assmtest.l
  260.    6                   ;******************************************
  261.    7                   ;                      ; comment treatment
  262.    8                   ;******************************************
  263.    9         0010      aa      =     $10      ; ';' immediately after the '0'
  264.   10         0020      B       =     $20 space to comment subfield
  265.   11         0030      C       =     $30        tab to comment subfield
  266.   12         FFEE      DEFGHIjkl =   $FFEE
  267.   13         FFEE      D       =DEFGHIjkl
  268.   14                   ;******************************************
  269.   15                   ; Number formats
  270.   16                   ;******************************************
  271.   17         0004      start   *=    $4       ; location counter adjust
  272.   18  0004   05                .byte %0101    ; binary number
  273.   19  0005   12 12 12          .byte 022,@22,^o22  ; octal numbers - three forms
  274.   20  0008   16                .byte 22       ; decimal number
  275.   21  0009   22 FF FF          .byte $22,$ff,$FF  ; hex - upper/lower case
  276.   22  000C   61 62             .byte 'a,'b    ; single ASCII characters
  277.   23                   ;******************************************
  278.   24                   ;                      ; ASCII character string
  279.   25                   ;******************************************
  280.   26  000E   61 62 63          .byte "abcd\t\n",0  ;   tab and new line escaped
  281.       0011   64 09 0A  
  282.       0014   00        
  283.   27                   ;******************************************
  284.   28                   ; Operation checks
  285.   29                   ;******************************************
  286.   30  0015   30 00             .word aa+B     ; addition
  287.   31  0017   F0 FF             .word aa-B     ; subtraction
  288.   32  0019   00 02             .word aa*B     ; multiplication
  289.   33  001B   02 00             .word B/aa     ; division
  290.   34  001D   10 00             .word C%B      ; modulo
  291.   35  001F   10 00             .word B!C      ; exclusive OR
  292.   36  0021   CF FF             .word ~C       ; one's complement
  293.   37  0023   20 00             .word B&C      ; logical AND
  294.   38  0025   30 00             .word aa|B     ; logical OR
  295.   39  0027   EE 00             .word D\       ; low byte
  296.   40  0029   FF 00             .word D^       ; high byte
  297.   41  002B   2B 00             .word *        ; current location
  298.   42  002D   10 00             .word aa,B,C
  299.       002F   20 00     
  300.       0031   30 00     
  301.   43  0033   00 08             .word B*<aa+C>  ; one level of parenthesis
  302.   44  0035   FF EE             .dbyt D        ; high byte-low byte word
  303.   45  0037   FF 00             .word D/256,D%256
  304.       0039   EE 00     
  305.   46                   ;******************************************
  306.   47                   ; Addressing Mode Check
  307.   48                   ;******************************************
  308.   49         0100              *=$0100
  309.   50  0100   A9 10             lda   =aa      ; immediate addressing
  310.   51  0102   A9 10             lda   #aa      ; immediate addressing, alternate
  311.   52  0104   AD EE FF          lda   D        ; direct addessing
  312.   53  0107   A5 10             LDA   aa       ; page zero addressing, aa < 256
  313.   54         0200      a1      =     512
  314.   55         01F4      a2      =     500
  315.   56  0109   A5 0C             lda   a1-a2    ; also page zero
  316.   57  010B   0A                asl   A        ; accumulator addressing
  317.   58  010C   0A                AsL   a        ; accumulator addressing also
  318.   59  010D   00                brk            ; implied addressing
  319.   60  010E   A1 10             lda   (aa,X)   ; indirect,X addressing
  320.   61  0110   B1 10             lda   (aa),Y   ; indirect,Y addressing
  321.   62  0112   B5 10             lda   aa,X     ; zero page,X addressing
  322.   63  0114   BD EE FF          lda   D,X      ; absolute,X addressing
  323.   64  0117   B9 EE FF          lda   D,Y      ; absolute,Y addressing
  324.   65  011A   90 EE             bcc   *-$10    ; relative addressing
  325.   66  011C   6C EE FF          jmp   (D)      ; indirect addressing
  326.   67  011F   7C F4 01          jmp   (a2,x)      ; abs indexed indirect
  327.   68  0122   72 10             adc   (aa)                ; indirect zero page
  328.   69  0124   B6 10             ldx   aa,Y     ; zero page,Y addressing
  329.   70  0126   B6 10             ldx   aa,y     ; alternate index name
  330.   72                   ;******************************************
  331.   73                   ; opcode check
  332.   74                   ;******************************************
  333.   75  0128   69 01             adc   =01
  334.   76  012A   29 01             and   =01
  335.   77  012C   32 10             and   (aa)
  336.   78  012E   0A                asl   A
  337.   79  012F   90 00             bcc   *+2
  338.   80  0131   B0 00             bcs   *+2
  339.   81  0133   F0 00             beq   *+2
  340.   82  0135   24 01             bit   $01
  341.   83  0137   3C 01 03          bit   $301,x
  342.   84  013A   34 01             bit   $01,x
  343.   85  013C   30 00             bmi   *+2
  344.   86  013E   D0 00             bne   *+2
  345.   87  0140   10 00             bpl   *+2
  346.   88  0142   80 00             bra   *+2
  347.   89  0144   00                brk
  348.   90  0145   50 00             bvc   *+2
  349.   91  0147   70 00             bvs   *+2
  350.   92  0149   18                clc
  351.   93  014A   D8                cld
  352.   94  014B   58                cli
  353.   95  014C   B8                clv
  354.   96  014D   C9 01             cmp   =01
  355.   97  014F   D2 10             cmp   (aa)
  356.   98  0151   E0 01             cpx   =01
  357.   99  0153   C0 01             cpy   =01
  358.  100  0155   3A                dea
  359.  101  0156   C6 01             dec   $01
  360.  102  0158   CA                dex
  361.  103  0159   88                dey
  362.  104  015A   49 01             eor   =01
  363.  105  015C   52 10             eor   (aa)
  364.  106  015E   1A                ina
  365.  107  015F   E6 01             inc   $01
  366.  108  0161   E8                inx
  367.  109  0162   C8                iny
  368.  110  0163   4C 66 01          jmp   *+3
  369.  111  0166   20 69 01          jsr   *+3
  370.  112  0169   A9 01             lda   =01
  371.  113  016B   B2 10             lda   (aa)
  372.  114  016D   A2 01             ldx   =01
  373.  115  016F   A0 01             ldy   =01
  374.  116  0171   4A                lsr   A
  375.  117  0172   EA                nop
  376.  118  0173   09 01             ora   =01
  377.  119  0175   12 10             ora   (aa)
  378.  120  0177   48                pha
  379.  121  0178   08                php
  380.  122  0179   DA                phx
  381.  123  017A   5A                phy
  382.  124  017B   68                pla
  383.  125  017C   28                plp
  384.  126  017D   FA                plx
  385.  127  017E   7A                ply
  386.  128  017F   2A                rol   A
  387.  129  0180   6A                ror   A
  388.  130  0181   40                rti
  389.  131  0182   60                rts
  390.  132  0183   E9 01             sbc   =01
  391.  133  0185   F2 10             sbc   (aa)
  392.  134  0187   38                sec
  393.  135  0188   F8                sed
  394.  136  0189   78                sei
  395.  137  018A   85 01             sta   $01
  396.  138  018C   92 10             sta   (aa)
  397.  139  018E   86 01             stx   $01
  398.  140  0190   84 01             sty   $01
  399.  141  0192   9C 01 03          stz   $301
  400.  142  0195   9E 01 03          stz   $301,x
  401.  143  0198   64 01             stz   $01
  402.  144  019A   74 01             stz   $01,x
  403.  145  019C   AA                tax
  404.  146  019D   A8                tay
  405.  147  019E   1C 01 03          trb   $301
  406.  148  01A1   14 01             trb   $01
  407.  149  01A3   0C 01 03          tsb   $301
  408.  150  01A6   04 01             tsb   $01
  409.  151  01A8   BA                tsx
  410.  152  01A9   8A                txa
  411.  153  01AA   9A                txs
  412.  154  01AB   98                tya
  413.  155                   .title  some     way for a listing
  414.  156                   .sbttl  check for .ifeq
  415.  157                           .ifeq 0
  416.  158  01AC   01 02 03          .byte 1,2,3,$34,@10
  417.       01AF   34 08     
  418.  159                           .endc
  419.  160                           .ifne 0
  420.  161                           .word 1234,$4354,@7777
  421.  162                           .endc
  422.  163                   ; now check nesting
  423.  164                           .ifeq 0
  424.  165  01B1   AD B1 01          lda   .
  425.  166                           .ifne 0
  426.  167                   m2      .asciz /help/
  427.  168                           .endc
  428.  169  01B4   ED EF F2  m3      nasc  <more of same>
  429.       01B7   E5 A0 EF  
  430.       01BA   E6 A0 F3  
  431.       01BD   E1 ED E5  
  432.  170                           .endc
  433.  171                           msb   ON
  434.  172  01C0   E8 E9 E7          .asciz /high order bits on /
  435.       01C3   E8 A0 EF  
  436.       01C6   F2 E4 E5  
  437.       01C9   F2 A0 E2  
  438.       01CC   E9 F4 F3  
  439.       01CF   A0 EF EE  
  440.       01D2   A0 00     
  441.  173  01D4   F3 E8 EF          nasc  <should not be affected>   1
  442.       01D7   F5 EC E4  
  443.       01DA   A0 EE EF  
  444.       01DD   F4 A0 E2  
  445.       01E0   E5 A0 E1  
  446.       01E3   E6 E6 E5  
  447.       01E6   E3 F4 E5  
  448.       01E9   E4 00     
  449.  174                           msb   off
  450.  175  01EB   68 69 67          .asciz /high order bits off/
  451.       01EE   68 20 6F  
  452.       01F1   72 64 65  
  453.       01F4   72 20 62  
  454.       01F7   69 74 73  
  455.       01FA   20 6F 66  
  456.       01FD   66 00     
  457.  176  01FF   F3 F4 E9          nasc  <still not affected>       0
  458.       0202   EC EC A0  
  459.       0205   EE EF F4  
  460.       0208   A0 E1 E6  
  461.       020B   E6 E5 E3  
  462.       020E   F4 E5 E4  
  463.  177         0213      m31     org   *+2
  464.  178  0213   35 02     m4      .word .+34
  465.  179         0217      m41     org   .+2
  466.  180  0217   00        m5      .byte 
  467.  181                   ;        now lets try some blank lines
  468.  182  0218   74 68 69          .asciz /this is ok?/
  469.       021B   73 20 69  
  470.       021E   73 20 6F  
  471.       0221   6B 3F 00  
  472.  183                   
  473.  184  0224   E8 EF F7          nasc  <how about this>
  474.       0227   A0 E1 E2  
  475.       022A   EF F5 F4  
  476.       022D   A0 F4 E8  
  477.       0230   E9 F3     
  478.  185                   
  479.  186  0232   00 0E             .byte 0,$e
  480.  187                   
  481.  188                   
  482.  189  0234   02 00             .word 2        ;how about two in a row
  483.  190                   .title  what  does the control l mean
  484.  191                   .sbttl  perhaps is the Dec 20 way of new page, anyway ignore it
  485.  192                           .ifeq 1
  486.  193                   .sbttl  Lets  check to see if we skip
  487.  194                           .asciz /this should not assemble/
  488.  195                   .sbttl  these lines
  489.  196                           .endc
  490.  197                   .sbttl  now   this is the living end
  491.  198         0013      aaaa    equ   aa+3
  492.  199         023C      aaa     equ   abc+5
  493.  200  0236   03                .byte 3
  494.  201  0237   F4 E8 E5  abc     nasc  <the end>
  495.       023A   A0 E5 EE  
  496.       023D   E4        
  497.  202  023E   FF                .byte 255
  498.  203         0100              org   $100
  499.  204  0100   31 00             .asciz /1/
  500.  205  0102   4C 18 01          jmp   d
  501.  206  0105   4C 1A 01          jmp   d+2
  502.  207  0108   AD 1A 01          lda   cba
  503.  208  010B   AD 33 02          lda   abc-4
  504.  209  010E   03                .byte 3
  505.  210  010F   B1                nasc  <1>
  506.  211  0110   B2 B2 00          nasc  <22> 1
  507.  212         011F      baaa    =     7+d         ; can you handle this
  508.  213  0113   F4 E8 F2          nasc  <three> 0
  509.       0116   E5 E5     
  510.  214  0118   A9 04     d       lda   #4
  511.  215  011A   29 09     cba     .word 2345
  512.  216         011C      bbc
  513.  217  011C   A6 01             ldx   d+3^
  514.  218  011E   AD 1A 01          lda   cba
  515.  219  0121   AD 1F 01          lda   baaa
  516.  220  0124   4C 1C 01          jmp   bbc
  517.  221  0127   A9 03             lda      #3
  518.  222  0129   A9 17     rep     lda   #23
  519.  223         00FE              org   $fe
  520.  224                           .ifeq <.\-$ff>    ;what does the loc counter say
  521.  225                           nop
  522.  226                           .endc
  523.  227                           .ifeq <.\-$fe>    ; loc ctr
  524.  228  00FE   EA                nop
  525.  229  00FF   EA                nop
  526.  230                           .endc
  527.  
  528. aa                      10:00    0010
  529. B                       20:00    0020
  530. C                       30:00    0030
  531. DEFGHIjkl               EE:FF    FFEE
  532. D                       EE:FF    FFEE
  533. start                   04:00    0004
  534. a1                      00:02    0200
  535. a2                      F4:01    01F4
  536. m2                      00:00    0000
  537. m3                      B4:01    01B4
  538. m31                     13:02    0213
  539. m4                      13:02    0213
  540. m41                     17:02    0217
  541. m5                      17:02    0217
  542. aaaa                    13:00    0013
  543. aaa                     3C:02    023C
  544. abc                     37:02    0237
  545. d                       18:01    0118
  546. cba                     1A:01    011A
  547. baaa                    1F:01    011F
  548. bbc                     1C:01    011C
  549. rep                     29:01    0129
  550. SHAR_EOF
  551. if test -f 'makefile'
  552. then
  553.     echo shar: over-writing existing file "'makefile'"
  554. fi
  555. cat << \SHAR_EOF > 'makefile'
  556. as6502:        assm0.o assm1.o assm2.o assm3.o
  557.         cc   assm0.o assm1.o assm2.o assm3.o -o as65c02
  558.  
  559. assm0.o:    assm.d1 assm.d2 assm0.c
  560.         cc -c -O assm0.c
  561.  
  562. assm1.o:    assm.d1 assm.d2 assm1.c
  563.         cc -c -O assm1.c
  564.  
  565. assm2.o:    assm.d1 assm.d2    assm2.c
  566.         cc -c -O assm2.c
  567.  
  568. assm3.o:    assm.d1 assm.d2 assm3.c
  569.         cc -c -O assm3.c
  570.  
  571. check:        assmtest.l
  572.  
  573. assmtest.l:    as6502 assmtest
  574.         as65c02 -nisv assmtest > temp
  575.         touch assmtest.l
  576.         diff assmtest.l temp
  577.  
  578. manuals:    as6502.l user.l
  579.  
  580. as6502.l:    as6502.1
  581.         nroff -man as6502.1 > as6502.l
  582.  
  583. user.l:        user.nr
  584.         nroff user.nr > user.l
  585.  
  586. clean:
  587.         rm assm0.o assm1.o assm2.o assm3.o temp as6502.l user.l
  588. SHAR_EOF
  589. if test -f 'user.nr'
  590. then
  591.     echo shar: over-writing existing file "'user.nr'"
  592. fi
  593. cat << \SHAR_EOF > 'user.nr'
  594. .de hd
  595. 'sp 3
  596. .tl ''\fBas6502 User Notes\fR'Page %'
  597. 'sp 2
  598. ..
  599. .de fo
  600. 'bp
  601. ..
  602. .wh 0 hd
  603. .wh -3 fo
  604. .br
  605. \fBSOURCE LINE FORMAT\fR:
  606. .ti 0.5i
  607. .sp 1
  608. <label> <operation> <operand> <comment>
  609. .sp 1
  610. Each field is terminated by one or more spaces, a tab or a ';' (which
  611. begins the comment field immediately).
  612. .sp
  613. \fBLABEL FIELD\fR:
  614. .sp 1
  615. If first character is ';', entire line is a comment.
  616. If first character is space, label field is null.
  617. Labels are alphanumeric strings beginning
  618. with 'a' through 'z', 'A' through 'Z',
  619. underscore or period followed by any of the above
  620. characters or '0' through '9'.
  621. Currently, labels are limited to 19 characters.
  622. A, X, Y, a, x and y are reserved labels.
  623. .sp
  624. \fBOPERATION FIELD\fR:
  625. .sp 1
  626. Upper and lower case letters are equivalent.
  627. Machine operation mnemonics are:
  628. .in 0.5i
  629. .nf
  630. .sp 1
  631. ADC     BMI     CLD     DEX     JSR     PHA     RTS     STY
  632. AND     BNE     CLI     DEY     LDA     PHP     SBC     TAX
  633. ASL     BPL     CLV     EOR     LDX     PLA     SEC     TAY
  634. BCC     BRK     CMP     INC     LDY     PLP     SED     TSX
  635. BCS     BVC     CPX     INX     LSR     ROL     SEI     TXA
  636. BEQ     BVS     CPY     INY     NOP     ROR     STA     TXS
  637. BIT     CLC     DEC     JMP     ORA     RTI     STX     TYA
  638. BRA     DEA     INA     PHX     PHY     PLX     PLY     STZ   TRB  TSB
  639. .in 0
  640. .fi
  641. .sp 1
  642. Pseudo operation mnemonics are:
  643. .in 1.2i
  644. .ti 0.5i
  645. .sp 1
  646. =      equate label name to operand field value
  647. (space is not needed to terminate this operation).
  648. .ti 0.5i
  649. *=     set location counter to operand field value
  650. (space is not needed to terminate this operation).
  651. .ti 0.5i
  652. .tr*.
  653. *WORD  assign 16 bit value of operand field to next
  654. two locations; low byte of value first, then high byte.
  655. .ti 0.5i
  656. *DBYT  assign 16 bit value of operand field to next
  657. two locations; high byte of value first, then low byte.
  658. .ti 0.5i
  659. *BYTE  assign 8 bit value of operand field to next
  660. location.
  661. .ti 0.5i
  662. *NLST  turn listing mode off (this source
  663. line is not listed).
  664. .ti 0.5i
  665. *LIST  turn listing mode on (normal mode) (this
  666. source line is not listed).
  667. .tr**
  668. .in 0
  669. .sp 1
  670. \fBOPERAND FIELD\fR:
  671. .sp 1
  672. Operand field expressions use infix notation and are evaluated strictly
  673. from left to right.
  674. No imbedded spaces are permitted.
  675. .sp 1
  676. Operand field terms include labels and numbers.
  677. Asterisk (*) is the label for the location counter value.
  678. Numbers are binary, octal, decimal, hexadecimal or ASCII.
  679. Number type is indicated by the first character of the number string as follows:
  680. .nf
  681. .in 0.5i
  682. .sp 1
  683. %       binary prefix
  684. @ or 0  octal prefix
  685. 1 - 9   decimal by default (prefix is part of number)
  686. $       hexadecimal prefix
  687. .tr,'
  688. ,       ASCII character prefix
  689. .tr,,
  690. "       ASCII character string prefix and suffix; in the
  691.         string, \\t is a tab character, \\n is a new line.
  692. .in 0
  693. .fi
  694. .sp 1
  695. Operand field operations and the corresponding symbols are:
  696. .in 0.5i
  697. .nf
  698. .sp 1
  699. +       addition
  700. -       subtraction
  701. /       division
  702. *       multiplication
  703. %       modulo (remainder after integer division)
  704. ^       logical exclusive OR
  705. &       logical AND
  706. |       logical OR
  707. <       low byte
  708. >       high byte
  709. .in 0
  710. .fi
  711. .sp 1
  712. \fBERROR MESSAGES\fR:
  713. .in 0.5i
  714. .nf
  715. .sp 1
  716. Invalid operation code
  717. Invalid argument count (when as6502 was invoked)
  718. Open error for file
  719. Creat error for object file 6502.out
  720. Close error
  721. Close error (6502.out)
  722. Symbol table full
  723. Label multiply defined
  724. Sync error (pass 1 symbol value not equal pass 2 symbol value)
  725. Invalid branch address
  726. Operand field missing
  727. Invalid addressing mode
  728. Operand field size error
  729. Undefined symbol in operand field
  730. Invalid operand field
  731. .fi
  732. .in 0
  733. .sp 1
  734. \fBINVOKING as6502\fR:
  735. .sp 1
  736. .ti 0.5i
  737. as6502 {-ilnos} <source files descriptions>
  738. .sp 1
  739. Options:
  740. .in 0.5i
  741. .nf
  742. .sp 1
  743. -i   ignore any .nlst pseudo operations
  744. -l   list errors only
  745. -n   print addresses as <high byte><low byte>,
  746.      rather than as <low byte>:<high byte>.
  747. -o   generate ASCII object output in file 6502.out,
  748.      format is
  749.           ;<address lo><address hi><data>
  750. -s   print symbol table at end of listing
  751. -v   print assembler version
  752.  
  753.                      J. H. Van Ornum  11/5/84
  754. SHAR_EOF
  755. #    End of shell archive
  756. exit 0
  757.  
  758.  
  759.