home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / appleii / appxas.1 / assmtest next >
Text File  |  2020-01-01  |  4KB  |  231 lines

  1. ;******************************************
  2. ; Test file for the 65c02 assembler - as65c02
  3. ; assemble as
  4. ;     as65c02 -nisv assmtest
  5. ; and compare output with assmtest.l
  6. ;******************************************
  7. ;; comment treatment
  8. ;******************************************
  9. aa = $10; ';' immediately after the '0'
  10. B = $20 space to comment subfield
  11. C = $30    tab to comment subfield
  12. DEFGHIjkl = $FFEE
  13. D =DEFGHIjkl
  14. ;******************************************
  15. ; Number formats
  16. ;******************************************
  17. start *= $4 ; location counter adjust
  18.  .byte %0101 ; binary number
  19.  .byte 022,@22,^o22 ; octal numbers - three forms
  20.  .byte 22 ; decimal number
  21.  .byte $22,$ff,$FF ; hex - upper/lower case
  22.  .byte 'a,'b ; single ASCII characters
  23. ;******************************************
  24. ;; ASCII character string
  25. ;******************************************
  26.  .byte "abcd\t\n",0 ;   tab and new line escaped
  27. ;******************************************
  28. ; Operation checks
  29. ;******************************************
  30.  .word aa+B ; addition
  31.  .word aa-B ; subtraction
  32.  .word aa*B ; multiplication
  33.  .word B/aa ; division
  34.  .word C%B ; modulo
  35.  .word B!C ; exclusive OR
  36.  .word ~C ; one's complement
  37.  .word B&C ; logical AND
  38.  .word aa|B ; logical OR
  39.  .word D\ ; low byte
  40.  .word D^ ; high byte
  41.  .word * ; current location
  42.  .word aa,B,C
  43.  .word B*<aa+C> ; one level of parenthesis
  44.  .dbyt D ; high byte-low byte word
  45.  .word D/256,D%256
  46. ;******************************************
  47. ; Addressing Mode Check
  48. ;******************************************
  49.  *=$0100
  50.  lda =aa ; immediate addressing
  51.  lda #aa ; immediate addressing, alternate
  52.  lda D ; direct addessing
  53.  LDA aa ; page zero addressing, aa < 256
  54. a1 = 512
  55. a2 = 500
  56.  lda a1-a2 ; also page zero
  57.  asl A ; accumulator addressing
  58.  AsL a ; accumulator addressing also
  59.  brk ; implied addressing
  60.  lda (aa,X) ; indirect,X addressing
  61.  lda (aa),Y ; indirect,Y addressing
  62.  lda aa,X ; zero page,X addressing
  63.  lda D,X ; absolute,X addressing
  64.  lda D,Y ; absolute,Y addressing
  65.  bcc *-$10 ; relative addressing
  66.  jmp (D) ; indirect addressing
  67.     jmp    (a2,x)    ; abs indexed indirect
  68.     adc    (aa)        ; indirect zero page
  69.  ldx aa,Y ; zero page,Y addressing
  70.  ldx aa,y ; alternate index name
  71.  .nlst
  72. ;******************************************
  73. ; opcode check
  74. ;******************************************
  75.  adc =01
  76.  and =01
  77.     and    (aa)
  78.  asl A
  79.  bcc *+2
  80.  bcs *+2
  81.  beq *+2
  82.  bit $01
  83.     bit $301,x
  84.     bit    $01,x
  85.  bmi *+2
  86.  bne *+2
  87.  bpl *+2
  88.     bra *+2
  89.  brk
  90.  bvc *+2
  91.  bvs *+2
  92.  clc
  93.  cld
  94.  cli
  95.  clv
  96.  cmp =01
  97.     cmp    (aa)
  98.  cpx =01
  99.  cpy =01
  100.     dea
  101.  dec $01
  102.  dex
  103.  dey
  104.  eor =01
  105.     eor    (aa)
  106.     ina
  107.  inc $01
  108.  inx
  109.  iny
  110.  jmp *+3
  111.  jsr *+3
  112.  lda =01
  113.     lda    (aa)
  114.  ldx =01
  115.  ldy =01
  116.  lsr A
  117.  nop
  118.  ora =01
  119.     ora    (aa)
  120.  pha
  121.  php
  122.     phx
  123.     phy
  124.  pla
  125.  plp
  126.     plx
  127.     ply
  128.  rol A
  129.  ror A
  130.  rti
  131.  rts
  132.  sbc =01
  133.     sbc    (aa)
  134.  sec
  135.  sed
  136.  sei
  137.  sta $01
  138.     sta    (aa)
  139.  stx $01
  140.  sty $01
  141.     stz    $301
  142.     stz    $301,x
  143.     stz    $01
  144.     stz    $01,x
  145.  tax
  146.  tay
  147.     trb    $301
  148.     trb    $01
  149.     tsb    $301
  150.     tsb    $01
  151.  tsx
  152.  txa
  153.  txs
  154.  tya
  155. .title    some     way for a listing
  156. .sbttl check for .ifeq
  157.     .ifeq    0
  158.     .byte    1,2,3,$34,@10
  159.     .endc
  160.     .ifne    0
  161.     .word    1234,$4354,@7777
  162.     .endc
  163. ; now check nesting
  164.     .ifeq    0
  165.     lda    .
  166.     .ifne    0
  167. m2    .asciz    /help/
  168.     .endc
  169. m3    nasc    <more of same>
  170.     .endc
  171.     msb    ON
  172.     .asciz    /high order bits on /
  173.     nasc    <should not be affected>    1
  174.     msb    off
  175.     .asciz    /high order bits off/
  176.     nasc    <still not affected>     0
  177. m31    org    *+2
  178. m4    .word    .+34
  179. m41    org    .+2
  180. m5    .byte    
  181. ;    now lets try some blank lines
  182.     .asciz    /this is ok?/
  183.  
  184.     nasc    <how about this>
  185.  
  186.     .byte    0,$e
  187.  
  188.  
  189.     .word    2    ;how about two in a row
  190. .title what does the control l mean
  191. .sbttl perhaps is the Dec 20 way of new page, anyway ignore it
  192.     .ifeq    1
  193. .sbttl Lets check to see if we skip
  194.     .asciz    /this should not assemble/
  195. .sbttl these lines
  196.     .endc
  197. .sbttl    now this is the living end
  198. aaaa    equ    aa+3
  199. aaa    equ    abc+5
  200.     .byte    3
  201. abc    nasc    <the end>
  202.     .byte    255
  203.     org    $100
  204.     .asciz /1/
  205.     jmp    d
  206.     jmp    d+2
  207.     lda    cba
  208.     lda    abc-4
  209.     .byte    3
  210.     nasc <1>
  211.     nasc <22> 1
  212. baaa    =    7+d    ; can you handle this
  213.     nasc <three> 0
  214. d    lda    #4
  215. cba    .word    2345
  216. bbc
  217.     ldx    d+3^
  218.     lda    cba
  219.     lda    baaa
  220.     jmp    bbc
  221.     lda     #3
  222. rep    lda    #23
  223.     org    $fe
  224.     .ifeq    <.\-$ff>    ;what does the loc counter say
  225.     nop
  226.     .endc
  227.     .ifeq    <.\-$fe>    ; loc ctr
  228.     nop
  229.     nop
  230.     .endc
  231.