fachat / xa65

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

Preprocessor replaces patterns in string constants #4

Closed fachat closed 4 years ago

fachat commented 4 years ago

If you have a string constant like

.asc "COPYCON^@DUP^@CD^@DEVCMD^@COPY^@" This breaks if there is a pre-processor define like `

define DUP 123

As a mitigation you have to split the string constant like so .asc "COPYCON^@D","UP^@CD^@DEVCMD^@COPY^@" `

fachat commented 4 years ago

Little test program: `

define DUP 123

    .asc "DUP^@"

    .asc '0DUP^@'

    .asc "D","UP^@"

    .asc "DUP

    .asc "DU0

    .asc "DU

`