fachat / xa65

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

Problems with / in strings #10

Closed ZornsLemma closed 2 years ago

ZornsLemma commented 2 years ago

Hi,

I've been discussing some strange xa behaviour with "TobyLobster" over on the stardot forums - you might like to take a look at this post and the one following it where Toby says what he thinks the problem is: https://stardot.org.uk/forums/viewtopic.php?p=351950#p351950

I've attached some test cases (test.zip). test1.xa fails to assemble:

$ cat test1.xa
* = $e00
    .asc "SIEx256SN" // foo
    .asc "SIE/256SN" // bar
    .asc "SIEy256SN" // baz
$ xa test1.xa
    .asc "SIE/256SN" // bar
test1.xa:line 3: 0e09:Syntax error
Break after 1 errors

test2.xa assembles but silently truncates one of the strings:

$ cat test2.xa
* = $e00
    .asc "SIEx256SN" // foo
    .asc "SIE//TOBY"
    .asc "SIEy256SN" // baz
$ xa test2.xa
$ xxd a.o65
00000000: 5349 4578 3235 3653 4e53 4945 5349 4579  SIEx256SNSIESIEy
00000010: 3235 3653 4e                             256SN
$ # Note that "//TOBY" is not present in the xxd output.

test3.xa also fails to assemble:

$ cat test3.xa
* = $e00
    lda #16/8        // this is a comment
$ xa test3.xa
    lda #16/8        // this is a comment
test3.xa:line 2: 0e00:Syntax error
Break after 1 errors

I hope this makes sense, let me know if you have any questions.

Cheers.

Steve

fachat commented 2 years ago

Hi Steve,

interesting find!

I am not the maintainer anymore, my repo is just following the original source from Cameron Kaiser (cc:)

@Cameron: here is the github issue report: https://github.com/fachat/xa65/ issues/10

Best regards André

On Dienstag, 8. März 2022 20:14:08 CET ZornsLemma wrote:

Hi,

I've been discussing some strange xa behaviour with "TobyLobster" over on the stardot forums - you might like to take a look at this post and the one following it where Toby says what he thinks the problem is: https://stardot.org.uk/forums/viewtopic.php?p=351950#p351950

I've attached some test cases (test.zip). test1.xa fails to assemble: ``` $ cat test1.xa

  • = $e00 .asc "SIEx256SN" // foo .asc "SIE/256SN" // bar .asc "SIEy256SN" // baz $ xa test1.xa .asc "SIE/256SN" // bar test1.xa:line 3: 0e09:Syntax error Break after 1 errors

test2.xa assembles but silently truncates one of the strings:

$ cat test2.xa
* = $e00
    .asc "SIEx256SN" // foo
    .asc "SIE//TOBY"
    .asc "SIEy256SN" // baz
$ xa test2.xa
$ xxd a.o65
00000000: 5349 4578 3235 3653 4e53 4945 5349 4579  SIEx256SNSIESIEy
00000010: 3235 3653 4e                             256SN
$ # Note that "//TOBY" is not present in the xxd output.

test3.xa also fails to assemble:

$ cat test3.xa
* = $e00
    lda #16/8        // this is a comment
$ xa test3.xa
    lda #16/8        // this is a comment
test3.xa:line 2: 0e00:Syntax error
Break after 1 errors

I hope this makes sense, let me know if you have any questions.

Cheers.

Steve

ZornsLemma commented 2 years ago

Thanks André, apologies for the misdirected report!

Steve

classilla commented 2 years ago

I have a fix for this. Thanks for the test case. Amazing no one ever hit it before.

classilla commented 2 years ago

This is in 2.3.13.

ZornsLemma commented 2 years ago

Thanks Cameron, I've just built 2.3.13 and it works a treat!