fachat / xa65

6502/65816 cross assembler
http://www.floodgap.com/retrotech/xa/
55 stars 8 forks source link

Some pointer arithmetic gives Syntax or Illegal errors #7

Closed fachat closed 3 years ago

fachat commented 4 years ago

Try to build the attached file with:

csapiec: csapiec.a65
        xa -R -o csapiec.o65 csapiec.a65

This will give you syntax errors like:

cmda    .byt cmdt-c0
csapiec.a65:line 20: 1044:Syntax error
        .byt <cow-c0
csapiec.a65:line 22: 1045:Syntax error
        .word <cow-c0
csapiec.a65:line 23: 1045:Illegal pointer arithmetic error
        .byt c2-c0, c3-c0, c4-c0, c5-c0, c6-c0, c7-c0 
csapiec.a65:line 24: 1045:Syntax error

So, subtracting two pointers from the same segment should give a segment-less number, which should be usable in a simple .byt or .word statement

csapiec.a65.txt

Edit: version 2.3.10