   .include #system
   .include #stddef
   .include #macros
   .include #cio

output=1
   .if output   
      open  2,12,0,"E:"
      print 2,"Starting the test"
   .endif
   dmove x1+1,bar
   sec
   jmp   over

x1   .byte        0,<really_long_identifier_named_foo,>really_long_identifier_named_foo,2

over  .if   output
         print 2,"Reached Mark 1"
      .endif
      sec
     jmp   (a2+2)


a1 .dbyte   $0234,foobar,$1230
a2 .word    $8000,xbar,$0102

xbar  .if output
         print 2,"Reached Mark 2"
   .endif
   sec
   jmp   $FFFF
bar   = * -2
   .byte "Hello",>xbar,"World",155
      
really_long_identifier_named_foo:
   lda   x1
   clc
   bcc   ov
   .byte 0,1,2

foobar:
   .if   output
      print 2,"ALRITE!!"
      close 2
   .endif
   rts
   
ov
   adc   x1+3
   cmp   #2
   bne   failed
   .if   output
      print 2,"Success 1"
   .endif
   jmp   good

failed:
   .if   output
      print 2,"Failure 1"
   .endif
   
good:
   print 2,bar+2,really_long_identifier_named_foo-bar
   lda   a1
   clc
   adc   a1+4
   cmp   #$14
   bne   fail2
   
   .if output
      print 2,"Success 2"
   .endif
   jmp   good2
   
fail2:
   .if output
      print 2,"Failure 2"
   .endif
good2:
   lda   a2+1
   clc
   adc   a2+5
   cmp   #$81
   bne   fail3
   
   .if output
      print 2,"Success 3"
   .endif
   jmp   good3
   
fail3:
   .if output
      print 3,"Failure 3"
   .endif

good3:   
   move  a1+2,a1+1
   move  a1+3,a1
   jmp   (a1)


