home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 1 / crawlyvol1.bin / program / compiler / nasm20b / libinc / demo / test.s65 < prev    next >
Text File  |  1993-01-19  |  1KB  |  102 lines

  1.    .include #system
  2.    .include #stddef
  3.    .include #macros
  4.    .include #cio
  5.  
  6. output=1
  7.    .if output   
  8.       open  2,12,0,"E:"
  9.       print 2,"Starting the test"
  10.    .endif
  11.    dmove x1+1,bar
  12.    sec
  13.    jmp   over
  14.  
  15. x1   .byte        0,<really_long_identifier_named_foo,>really_long_identifier_named_foo,2
  16.  
  17. over  .if   output
  18.          print 2,"Reached Mark 1"
  19.       .endif
  20.       sec
  21.      jmp   (a2+2)
  22.  
  23.  
  24. a1 .dbyte   $0234,foobar,$1230
  25. a2 .word    $8000,xbar,$0102
  26.  
  27. xbar  .if output
  28.          print 2,"Reached Mark 2"
  29.    .endif
  30.    sec
  31.    jmp   $FFFF
  32. bar   = * -2
  33.    .byte "Hello",>xbar,"World",155
  34.       
  35. really_long_identifier_named_foo:
  36.    lda   x1
  37.    clc
  38.    bcc   ov
  39.    .byte 0,1,2
  40.  
  41. foobar:
  42.    .if   output
  43.       print 2,"ALRITE!!"
  44.       close 2
  45.    .endif
  46.    rts
  47.    
  48. ov
  49.    adc   x1+3
  50.    cmp   #2
  51.    bne   failed
  52.    .if   output
  53.       print 2,"Success 1"
  54.    .endif
  55.    jmp   good
  56.  
  57. failed:
  58.    .if   output
  59.       print 2,"Failure 1"
  60.    .endif
  61.    
  62. good:
  63.    print 2,bar+2,really_long_identifier_named_foo-bar
  64.    lda   a1
  65.    clc
  66.    adc   a1+4
  67.    cmp   #$14
  68.    bne   fail2
  69.    
  70.    .if output
  71.       print 2,"Success 2"
  72.    .endif
  73.    jmp   good2
  74.    
  75. fail2:
  76.    .if output
  77.       print 2,"Failure 2"
  78.    .endif
  79. good2:
  80.    lda   a2+1
  81.    clc
  82.    adc   a2+5
  83.    cmp   #$81
  84.    bne   fail3
  85.    
  86.    .if output
  87.       print 2,"Success 3"
  88.    .endif
  89.    jmp   good3
  90.    
  91. fail3:
  92.    .if output
  93.       print 3,"Failure 3"
  94.    .endif
  95.  
  96. good3:   
  97.    move  a1+2,a1+1
  98.    move  a1+3,a1
  99.    jmp   (a1)
  100.  
  101.  
  102.