From 32d1147eecdb834a29f3d66c8dc15ce3b9e83868 Mon Sep 17 00:00:00 2001
From: Andy McFadden
The character encoding can be selected, offering a choice between plain ASCII, low + high ASCII, C64 PETSCII, and C64 screen codes. When you change the encoding, your available options may change. The @@ -137,7 +142,7 @@ low + high ASCII setting will accept both, configuring the appropriate encoding based on the data values, but when identifying multiple strings it requires that each individual string be entirely one or the other.
Due to fundamental limitations of the character set, C64 screen code -strings cannot be null terminated.
+strings cannot be null terminated ($00 is '@').To avoid burying a label in the middle of a data item, contiguous areas are split at labels. This can sometimes have unexpected effects. For diff --git a/SourceGen/SGTestData/Expected/1000-allops-value-65816_64tass.S b/SourceGen/SGTestData/Expected/1000-allops-value-65816_64tass.S index 753cc77..c49cedd 100644 --- a/SourceGen/SGTestData/Expected/1000-allops-value-65816_64tass.S +++ b/SourceGen/SGTestData/Expected/1000-allops-value-65816_64tass.S @@ -1,6 +1,4 @@ .cpu "65816" - .enc sg_ascii - .cdef $20,$7e,$20 * = $1000 .as .xs diff --git a/SourceGen/SGTestData/Expected/1001-allops-zero-65816_64tass.S b/SourceGen/SGTestData/Expected/1001-allops-zero-65816_64tass.S index 7fd1c66..968251d 100644 --- a/SourceGen/SGTestData/Expected/1001-allops-zero-65816_64tass.S +++ b/SourceGen/SGTestData/Expected/1001-allops-zero-65816_64tass.S @@ -1,6 +1,4 @@ .cpu "65816" - .enc sg_ascii - .cdef $20,$7e,$20 * = $1000 .as .xs diff --git a/SourceGen/SGTestData/Expected/1002-embedded-instructions_64tass.S b/SourceGen/SGTestData/Expected/1002-embedded-instructions_64tass.S index adfb9e1..89af921 100644 --- a/SourceGen/SGTestData/Expected/1002-embedded-instructions_64tass.S +++ b/SourceGen/SGTestData/Expected/1002-embedded-instructions_64tass.S @@ -1,6 +1,4 @@ .cpu "65816" - .enc sg_ascii - .cdef $20,$7e,$20 * = $1000 .as .xs diff --git a/SourceGen/SGTestData/Expected/1003-flags-and-branches_64tass.S b/SourceGen/SGTestData/Expected/1003-flags-and-branches_64tass.S index e9baca2..78d101c 100644 --- a/SourceGen/SGTestData/Expected/1003-flags-and-branches_64tass.S +++ b/SourceGen/SGTestData/Expected/1003-flags-and-branches_64tass.S @@ -1,6 +1,4 @@ .cpu "65816" - .enc sg_ascii - .cdef $20,$7e,$20 * = $1000 .as .xs diff --git a/SourceGen/SGTestData/Expected/2000-allops-value-6502_64tass.S b/SourceGen/SGTestData/Expected/2000-allops-value-6502_64tass.S index ed734a8..fb631c9 100644 --- a/SourceGen/SGTestData/Expected/2000-allops-value-6502_64tass.S +++ b/SourceGen/SGTestData/Expected/2000-allops-value-6502_64tass.S @@ -1,6 +1,4 @@ .cpu "6502i" - .enc sg_ascii - .cdef $20,$7e,$20 * = $1000 jsr L1035 jsr L1038 diff --git a/SourceGen/SGTestData/Expected/2001-allops-zero-6502_64tass.S b/SourceGen/SGTestData/Expected/2001-allops-zero-6502_64tass.S index cd4914a..20b9367 100644 --- a/SourceGen/SGTestData/Expected/2001-allops-zero-6502_64tass.S +++ b/SourceGen/SGTestData/Expected/2001-allops-zero-6502_64tass.S @@ -1,6 +1,4 @@ .cpu "6502i" - .enc sg_ascii - .cdef $20,$7e,$20 * = $1000 jsr L1035 jsr L1038 diff --git a/SourceGen/SGTestData/Expected/2002-allops-value-65C02_64tass.S b/SourceGen/SGTestData/Expected/2002-allops-value-65C02_64tass.S index 24bab97..e15b12a 100644 --- a/SourceGen/SGTestData/Expected/2002-allops-value-65C02_64tass.S +++ b/SourceGen/SGTestData/Expected/2002-allops-value-65C02_64tass.S @@ -1,6 +1,4 @@ .cpu "65c02" - .enc sg_ascii - .cdef $20,$7e,$20 * = $1000 jsr L1014 jsr L108A diff --git a/SourceGen/SGTestData/Expected/2003-allops-zero-65C02_64tass.S b/SourceGen/SGTestData/Expected/2003-allops-zero-65C02_64tass.S index 7f00a61..c3c9c95 100644 --- a/SourceGen/SGTestData/Expected/2003-allops-zero-65C02_64tass.S +++ b/SourceGen/SGTestData/Expected/2003-allops-zero-65C02_64tass.S @@ -1,6 +1,4 @@ .cpu "65c02" - .enc sg_ascii - .cdef $20,$7e,$20 * = $1000 jsr L1014 jsr L108A diff --git a/SourceGen/SGTestData/Expected/2004-numeric-types_64tass.S b/SourceGen/SGTestData/Expected/2004-numeric-types_64tass.S index e89e053..f310257 100644 --- a/SourceGen/SGTestData/Expected/2004-numeric-types_64tass.S +++ b/SourceGen/SGTestData/Expected/2004-numeric-types_64tass.S @@ -1,7 +1,5 @@ ;Project file was edited to get all big-endian data types. .cpu "6502" - .enc sg_ascii - .cdef $20,$7e,$20 * = $1000 rts diff --git a/SourceGen/SGTestData/Expected/2005-string-types_64tass.S b/SourceGen/SGTestData/Expected/2005-string-types_64tass.S index fd79a72..1f2c2f6 100644 --- a/SourceGen/SGTestData/Expected/2005-string-types_64tass.S +++ b/SourceGen/SGTestData/Expected/2005-string-types_64tass.S @@ -1,5 +1,7 @@ ;Project file was edited to get zero-length strings and reverse DCI. .cpu "6502" + .enc sg_hiascii + .cdef $20,$7e,$a0 .enc sg_ascii .cdef $20,$7e,$20 * = $1000 @@ -7,13 +9,16 @@ .text "low ASCII str" .byte $80 - .byte $e8,$e9,$e7,$e8,$a0,$c1,$d3,$c3,$c9,$c9,$a0,$f3,$f4,$f2 + .enc sg_hiascii + .text "high ASCII str" .byte $80 + .enc sg_ascii .text "'low'quoted",$22,"''text" .byte $80 - .byte $a2,$e8,$e9,$e7,$e8,$a2,$f1,$f5,$ef,$f4,$e5,$e4,$a7,$a2,$a2,$f4 - .byte $e5,$f8,$f4 + .enc sg_hiascii + .text $a2,"high",$a2,"quoted'",$a2,$a2,"text" .byte $80 + .enc sg_ascii .text "01234567890123456789012345678901234567890123456789012345678901" .text "234567890123456789" .byte $80 @@ -45,14 +50,19 @@ .text "0123456789012345678901234567890123456789012345678901678901",$22 .text $22,$22 .byte $81 - .fill 62,$aa + .enc sg_hiascii + .text "**************************************************************" .byte $80 - .fill 96,$aa + .text "**************************************************************" + .text "**********************************" .byte $81 + .enc sg_ascii .text "ver IICSA wol" .byte $80 - .byte $f6,$e5,$f2,$a0,$c9,$c9,$c3,$d3,$c1,$a0,$e8,$e7,$e9,$e8 + .enc sg_hiascii + .text "ver IICSA hgih" .byte $80 + .enc sg_ascii .text ".eeht rof sllot ti ;sllot lleb eht mohw rof wonk ot dnes reven" .text " erofereht dna ,dniknam ni devlovni ma I esuaceb ,em sehsinimi" .text "d htaed snam ynA .erew nwo eniht fo ro sdneirf yht fo ronam a" @@ -65,13 +75,16 @@ .byte $80 .null "low ASCII strz" .byte $80 - .byte $e8,$e9,$e7,$e8,$a0,$c1,$d3,$c3,$c9,$c9,$a0,$f3,$f4,$f2,$fa,$00 + .enc sg_hiascii + .null "high ASCII strz" .byte $80 + .enc sg_ascii .null "'low'quoted",$22,"''text" .byte $80 - .byte $a2,$e8,$e9,$e7,$e8,$a2,$f1,$f5,$ef,$f4,$e5,$e4,$a7,$a2,$a2,$f4 - .byte $e5,$f8,$f4,$00 + .enc sg_hiascii + .null $a2,"high",$a2,"quoted'",$a2,$a2,"text" .byte $80 + .enc sg_ascii .text "012345678901234567890123456789012345678901234567890123456789''" .text "'",$00 .byte $80 @@ -82,13 +95,16 @@ .byte $80 .ptext "low ASCII str1" .byte $80 - .byte $0f,$e8,$e9,$e7,$e8,$a0,$c1,$d3,$c3,$c9,$c9,$a0,$f3,$f4,$f2,$b1 + .enc sg_hiascii + .ptext "high ASCII str1" .byte $80 + .enc sg_ascii .ptext "'low'quoted",$22,"''text" .byte $80 - .byte $13,$a2,$e8,$e9,$e7,$e8,$a2,$f1,$f5,$ef,$f4,$e5,$e4,$a7,$a2,$a2 - .byte $f4,$e5,$f8,$f4 + .enc sg_hiascii + .ptext $a2,"high",$a2,"quoted'",$a2,$a2,"text" .byte $80 + .enc sg_ascii .text $3f,"0123456789012345678901234567890123456789012345678901234567" .text "89'''" .byte $80 @@ -99,14 +115,16 @@ .byte $80 .text $0e,$00,"low ASCII str2" .byte $80 - .byte $0f,$00,$e8,$e9,$e7,$e8,$a0,$c1,$d3,$c3,$c9,$c9,$a0,$f3,$f4,$f2 - .byte $b2 + .enc sg_hiascii + .text $0f,$00,"high ASCII str2" .byte $80 + .enc sg_ascii .text $12,$00,"'low'quoted",$22,"''text" .byte $80 - .byte $13,$00,$a2,$e8,$e9,$e7,$e8,$a2,$f1,$f5,$ef,$f4,$e5,$e4,$a7,$a2 - .byte $a2,$f4,$e5,$f8,$f4 + .enc sg_hiascii + .text $13,$00,$a2,"high",$a2,"quoted'",$a2,$a2,"text" .byte $80 + .enc sg_ascii .text $3f,$00,"012345678901234567890123456789012345678901234567890123" .text "456789'''" .byte $80 @@ -123,13 +141,17 @@ .byte $81 .shift "low ASCII dci" .byte $80 + .enc sg_hiascii .byte $e8,$e9,$e7,$e8,$a0,$c1,$d3,$c3,$c9,$c9,$a0,$e4,$e3,$69 .byte $80 + .enc sg_ascii .shift "'low'quoted",$22,"''text" .byte $80 + .enc sg_hiascii .byte $a2,$e8,$e9,$e7,$e8,$a2,$f1,$f5,$ef,$f4,$e5,$e4,$a7,$a2,$a2,$f4 .byte $e5,$f8,$74 .byte $80 + .enc sg_ascii .text "012345678901234567890123456789012345678901234567890123456789''" .text $a7 .byte $80 diff --git a/SourceGen/SGTestData/Expected/2006-operand-formats_64tass.S b/SourceGen/SGTestData/Expected/2006-operand-formats_64tass.S index 1cf0673..f192c15 100644 --- a/SourceGen/SGTestData/Expected/2006-operand-formats_64tass.S +++ b/SourceGen/SGTestData/Expected/2006-operand-formats_64tass.S @@ -1,5 +1,7 @@ ;Project file was edited for some ASCII operands. .cpu "65816" + .enc sg_hiascii + .cdef $20,$7e,$a0 .enc sg_ascii .cdef $20,$7e,$20 * = $1000 diff --git a/SourceGen/SGTestData/Expected/2008-address-changes_64tass.S b/SourceGen/SGTestData/Expected/2008-address-changes_64tass.S index 6b7d3f1..533ffb9 100644 --- a/SourceGen/SGTestData/Expected/2008-address-changes_64tass.S +++ b/SourceGen/SGTestData/Expected/2008-address-changes_64tass.S @@ -1,6 +1,4 @@ .cpu "65816" - .enc sg_ascii - .cdef $20,$7e,$20 * = $1000 .as .xs diff --git a/SourceGen/SGTestData/Expected/2009-branches-and-banks_64tass.S b/SourceGen/SGTestData/Expected/2009-branches-and-banks_64tass.S index 8d953a5..a676e7e 100644 --- a/SourceGen/SGTestData/Expected/2009-branches-and-banks_64tass.S +++ b/SourceGen/SGTestData/Expected/2009-branches-and-banks_64tass.S @@ -1,6 +1,4 @@ .cpu "65816" - .enc sg_ascii - .cdef $20,$7e,$20 longsym = $123456 * = $1000 diff --git a/SourceGen/SGTestData/Expected/2011-hinting_64tass.S b/SourceGen/SGTestData/Expected/2011-hinting_64tass.S index 2c47b83..16c6d08 100644 --- a/SourceGen/SGTestData/Expected/2011-hinting_64tass.S +++ b/SourceGen/SGTestData/Expected/2011-hinting_64tass.S @@ -1,6 +1,4 @@ .cpu "6502" - .enc sg_ascii - .cdef $20,$7e,$20 * = $1000 .byte $03 .byte $02 diff --git a/SourceGen/SGTestData/Expected/2012-label-localizer_64tass.S b/SourceGen/SGTestData/Expected/2012-label-localizer_64tass.S index 43373d6..169d0b6 100644 --- a/SourceGen/SGTestData/Expected/2012-label-localizer_64tass.S +++ b/SourceGen/SGTestData/Expected/2012-label-localizer_64tass.S @@ -1,6 +1,4 @@ .cpu "65816" - .enc sg_ascii - .cdef $20,$7e,$20 REALLYLONGLABELNAME = $8888 ;that's a long name * = $1000 diff --git a/SourceGen/SGTestData/Expected/2013-notes-and-comments_64tass.S b/SourceGen/SGTestData/Expected/2013-notes-and-comments_64tass.S index 5030bad..ab4e8ad 100644 --- a/SourceGen/SGTestData/Expected/2013-notes-and-comments_64tass.S +++ b/SourceGen/SGTestData/Expected/2013-notes-and-comments_64tass.S @@ -14,8 +14,6 @@ ;* * ;*************************************** .cpu "6502" - .enc sg_ascii - .cdef $20,$7e,$20 plataddr = $3000 ;address only in platform file ;Short, unboxed comment here!! diff --git a/SourceGen/SGTestData/Expected/2014-label-dp_64tass.S b/SourceGen/SGTestData/Expected/2014-label-dp_64tass.S index 3ffce5b..b76f1d9 100644 --- a/SourceGen/SGTestData/Expected/2014-label-dp_64tass.S +++ b/SourceGen/SGTestData/Expected/2014-label-dp_64tass.S @@ -1,7 +1,5 @@ ;6502bench SourceGen v1.1.0-dev1 .cpu "65816" - .enc sg_ascii - .cdef $20,$7e,$20 * = $1000 .as .xs diff --git a/SourceGen/SGTestData/Expected/2015-64k-nops_64tass.S b/SourceGen/SGTestData/Expected/2015-64k-nops_64tass.S index dea6275..9718d2b 100644 --- a/SourceGen/SGTestData/Expected/2015-64k-nops_64tass.S +++ b/SourceGen/SGTestData/Expected/2015-64k-nops_64tass.S @@ -1,6 +1,4 @@ .cpu "6502" - .enc sg_ascii - .cdef $20,$7e,$20 * = $0000 nop nop diff --git a/SourceGen/SGTestData/Expected/2016-char-encoding-a_64tass.S b/SourceGen/SGTestData/Expected/2016-char-encoding-a_64tass.S index c53a433..e80bfe9 100644 --- a/SourceGen/SGTestData/Expected/2016-char-encoding-a_64tass.S +++ b/SourceGen/SGTestData/Expected/2016-char-encoding-a_64tass.S @@ -1,5 +1,7 @@ ;Project edited to mark some non-ASCII operands as ASCII. .cpu "65816" + .enc sg_hiascii + .cdef $20,$7e,$a0 .enc sg_ascii .cdef $20,$7e,$20 * = $1000 @@ -10,123 +12,133 @@ sep #$30 lda #'A' lda #'A' | $80 - lda #$c1 - lda #$41 + .enc none + lda #'A' + .enc screen + lda #'A' + .enc sg_ascii ldx #'a' ldx #'a' | $80 - ldx #$41 - ldx #$01 + .enc none + ldx #'a' + .enc screen + ldx #'a' + .enc sg_ascii lda #$7f lda #$7f + .enc none lda #$7f + .enc screen lda #$7f + .enc sg_ascii lda #$0d rep #$30 .al .xl lda #'B' lda #'B' | $80 - lda #$c2 - lda #$42 + .enc none + lda #'B' + .enc screen + lda #'B' sep #$30 .as .xs rts + .enc sg_ascii .byte 'C' .byte 'C' | $80 - .byte $c3 - .byte $43 + .enc none + .byte 'C' + .enc screen + .byte 'C' + .enc sg_ascii .word 'd' .word 'd' | $80 - .word $44 - .word $04 + .enc none + .word 'd' + .enc screen + .word 'd' .byte $00,$45 .byte $00,$c5 .byte $00,$c5 .byte $00,$45 .byte $80 + .enc sg_ascii .text "low ASCII str" - .byte $e8,$e9,$e7,$e8,$a0,$c1,$d3,$c3,$c9,$c9,$a0,$f3,$f4,$f2 + .enc sg_hiascii + .text "high ASCII str" .byte $80 - .byte $d0,$c5,$d4,$d3,$c3,$c9,$c9,$20,$53,$54,$52 + .enc none + .text "PETSCII str" .byte $80 - .byte $53,$03,$12,$05,$05,$0e,$20,$43,$0f,$04,$05,$20,$13,$14,$12 + .enc screen + .text "Screen Code str" .byte $82 + .enc sg_ascii .text $07,"Low ASCII CRLF",$0d,$0a .byte $82 - .byte $87,$c8,$e9,$e7,$e8,$a0,$c1,$d3,$c3,$c9,$c9,$a0,$c3,$d2,$cc,$c6 - .byte $8d,$8a + .enc sg_hiascii + .text $87,"High ASCII CRLF",$8d,$8a .byte $82 - .byte $93,$d0,$c5,$d4,$d3,$c3,$c9,$c9,$20,$57,$49,$54,$48,$20,$96,$43 - .byte $4f,$4e,$54,$52,$4f,$4c,$05,$20,$43,$4f,$44,$45,$53,$0d + .enc none + .text $93,"PETSCII with ",$96,"control",$05," codes",$0d .byte $83 + .enc sg_ascii .text " !",$22,"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVW" .text "XYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~" .byte $83 - .byte $a0,$a1,$a2,$a3,$a4,$a5,$a6,$a7,$a8,$a9,$aa,$ab,$ac,$ad,$ae,$af - .byte $b0,$b1,$b2,$b3,$b4,$b5,$b6,$b7,$b8,$b9,$ba,$bb,$bc,$bd,$be,$bf - .byte $c0,$c1,$c2,$c3,$c4,$c5,$c6,$c7,$c8,$c9,$ca,$cb,$cc,$cd,$ce,$cf - .byte $d0,$d1,$d2,$d3,$d4,$d5,$d6,$d7,$d8,$d9,$da,$db,$dc,$dd,$de,$df - .byte $e0,$e1,$e2,$e3,$e4,$e5,$e6,$e7,$e8,$e9,$ea,$eb,$ec,$ed,$ee,$ef - .byte $f0,$f1,$f2,$f3,$f4,$f5,$f6,$f7,$f8,$f9,$fa,$fb,$fc,$fd,$fe + .enc sg_hiascii + .text " !",$a2,"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVW" + .text "XYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~" .byte $83 - .byte $20,$21,$22,$23,$24,$25,$26,$27,$28,$29,$2a,$2b,$2c,$2d,$2e,$2f - .byte $30,$31,$32,$33,$34,$35,$36,$37,$38,$39,$3a,$3b,$3c,$3d,$3e,$3f - .byte $40,$c1,$c2,$c3,$c4,$c5,$c6,$c7,$c8,$c9,$ca,$cb,$cc,$cd,$ce,$cf - .byte $d0,$d1,$d2,$d3,$d4,$d5,$d6,$d7,$d8,$d9,$da,$5b + .enc none + .text " !",$22,"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVW" + .text "XYZ[" .byte $5c - .byte $5d + .byte ']' .byte $5e .byte $5f .byte $60 - .byte $41,$42,$43,$44,$45,$46,$47,$48,$49,$4a,$4b,$4c,$4d,$4e,$4f,$50 - .byte $51,$52,$53,$54,$55,$56,$57,$58,$59,$5a + .text "abcdefghijklmnopqrstuvwxyz" + .enc sg_ascii .text "{|}~" .byte $83 - .byte $20,$21,$22,$23,$24,$25,$26,$27,$28,$29,$2a,$2b,$2c,$2d,$2e,$2f - .byte $30,$31,$32,$33,$34,$35,$36,$37,$38,$39,$3a,$3b,$3c,$3d,$3e,$3f - .byte $00,$41,$42,$43,$44,$45,$46,$47,$48,$49,$4a,$4b,$4c,$4d,$4e,$4f - .byte $50,$51,$52,$53,$54,$55,$56,$57,$58,$59,$5a,$1b + .enc screen + .text " !",$22,"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVW" + .text "XYZ[" .byte $1c - .byte $1d + .byte ']' .byte $1e .byte $1f .byte $40 - .byte $01,$02,$03,$04,$05,$06,$07,$08,$09,$0a,$0b,$0c,$0d,$0e,$0f,$10 - .byte $11,$12,$13,$14,$15,$16,$17,$18,$19,$1a + .text "abcdefghijklmnopqrstuvwxyz" + .enc sg_ascii .text "{|}~" .byte $84 - .byte $c9,$c9,$c3,$d3,$d4,$c5,$d0,$20,$45,$53,$52,$45,$56,$45,$52 + .enc none + .text "IICSTEP esrever" .byte $84 - .byte $4e,$55,$4c,$4c,$20,$54,$45,$52,$4d,$20,$d0,$c5,$d4,$d3,$c3,$c9 - .byte $c9,$00 + .null "null term PETSCII" .byte $84 - .byte $d4,$48,$49,$53,$20,$4e,$55,$4c,$4c,$2d,$54,$45,$52,$4d,$49,$4e - .byte $41,$54,$45,$44,$20,$53,$54,$52,$49,$4e,$47,$20,$49,$53,$20,$54 - .byte $4f,$4f,$20,$4c,$4f,$4e,$47,$20,$54,$4f,$20,$46,$49,$54,$20,$4f - .byte $4e,$20,$41,$20,$53,$49,$4e,$47,$4c,$45,$20,$4c,$49,$4e,$45,$2c - .byte $20,$41,$4e,$44,$20,$57,$49,$4c,$4c,$20,$42,$45,$20,$53,$50,$4c - .byte $49,$54,$2e,$00 + .text "This null-terminated string is too long to fit on a single lin" + .text "e, and will be split.",$00 .byte $84 - .byte $13,$d0,$c5,$d4,$d3,$c3,$c9,$c9,$20,$57,$49,$54,$48,$20,$4c,$45 - .byte $4e,$47,$54,$48 + .ptext "PETSCII with length" .byte $84 - .byte $14,$00,$d0,$c5,$d4,$d3,$c3,$c9,$c9,$20,$57,$49,$54,$48,$20,$4c - .byte $45,$4e,$47,$54,$48,$32 + .text $14,$00,"PETSCII with length2" .byte $84 - .byte $50,$45,$54,$20,$44,$43,$c9 + .shift "pet dci" .byte $84 - .byte $05,$04,$0f,$43,$20,$0e,$05,$05,$12,$03,$53,$20,$05,$13,$12,$05 - .byte $16,$05,$12 + .enc screen + .text "edoC neercS esrever" .byte $84 - .byte $17,$53,$03,$12,$05,$05,$0e,$20,$43,$0f,$04,$05,$20,$17,$09,$14 - .byte $08,$20,$0c,$05,$0e,$07,$14,$08 + .ptext "Screen Code with length" .byte $84 - .byte $18,$00,$53,$03,$12,$05,$05,$0e,$20,$43,$0f,$04,$05,$20,$17,$09 - .byte $14,$08,$20,$0c,$05,$0e,$07,$14,$08,$32 + .text $18,$00,"Screen Code with length2" .byte $84 - .byte $53,$03,$12,$05,$05,$0e,$20,$43,$0f,$04,$05,$20,$44,$43,$c9 + .shift "Screen Code DCI" .byte $84 .byte $85 ;$00-ff block @@ -162,6 +174,7 @@ .byte $1d .byte $1e .byte $1f + .enc sg_ascii .text " !",$22,"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVW" .text "XYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~" .byte $7f diff --git a/SourceGen/SGTestData/Expected/2017-char-encoding-p_64tass.S b/SourceGen/SGTestData/Expected/2017-char-encoding-p_64tass.S index 25ac70b..fd0b87d 100644 --- a/SourceGen/SGTestData/Expected/2017-char-encoding-p_64tass.S +++ b/SourceGen/SGTestData/Expected/2017-char-encoding-p_64tass.S @@ -1,78 +1,99 @@ ;Project edited to mark some non-ASCII operands as ASCII. .cpu "65816" + .enc sg_hiascii + .cdef $20,$7e,$a0 + .enc sg_ascii + .cdef $20,$7e,$20 * = $1000 .as .xs clc xce sep #$30 - lda #$41 - lda #$c1 lda #'A' - lda #$41 - ldx #$61 - ldx #$e1 + lda #'A' | $80 + .enc none + lda #'A' + .enc screen + lda #'A' + .enc sg_ascii ldx #'a' - ldx #$01 + ldx #'a' | $80 + .enc none + ldx #'a' + .enc screen + ldx #'a' + .enc sg_ascii lda #$7f lda #$7f + .enc none lda #$7f + .enc screen lda #$7f + .enc sg_ascii lda #$0d rep #$30 .al .xl - lda #$42 - lda #$c2 lda #'B' - lda #$42 + lda #'B' | $80 + .enc none + lda #'B' + .enc screen + lda #'B' sep #$30 .as .xs rts - .byte $43 - .byte $c3 + .enc sg_ascii .byte 'C' - .byte $43 - .word $64 - .word $e4 + .byte 'C' | $80 + .enc none + .byte 'C' + .enc screen + .byte 'C' + .enc sg_ascii + .word 'd' + .word 'd' | $80 + .enc none + .word 'd' + .enc screen .word 'd' - .word $04 .byte $00,$45 .byte $00,$c5 .byte $00,$c5 .byte $00,$45 .byte $80 - .byte $6c,$6f,$77,$20,$41,$53,$43,$49,$49,$20,$73,$74,$72 - .byte $e8,$e9,$e7,$e8,$a0,$c1,$d3,$c3,$c9,$c9,$a0,$f3,$f4,$f2 + .enc sg_ascii + .text "low ASCII str" + .enc sg_hiascii + .text "high ASCII str" .byte $80 + .enc none .text "PETSCII str" .byte $80 - .byte $53,$03,$12,$05,$05,$0e,$20,$43,$0f,$04,$05,$20,$13,$14,$12 + .enc screen + .text "Screen Code str" .byte $82 - .byte $07,$4c,$6f,$77,$20,$41,$53,$43,$49,$49,$20,$43,$52,$4c,$46,$0d - .byte $0a + .enc sg_ascii + .text $07,"Low ASCII CRLF",$0d,$0a .byte $82 - .byte $87,$c8,$e9,$e7,$e8,$a0,$c1,$d3,$c3,$c9,$c9,$a0,$c3,$d2,$cc,$c6 - .byte $8d,$8a + .enc sg_hiascii + .text $87,"High ASCII CRLF",$8d,$8a .byte $82 + .enc none .text $93,"PETSCII with ",$96,"control",$05," codes",$0d .byte $83 - .byte $20,$21,$22,$23,$24,$25,$26,$27,$28,$29,$2a,$2b,$2c,$2d,$2e,$2f - .byte $30,$31,$32,$33,$34,$35,$36,$37,$38,$39,$3a,$3b,$3c,$3d,$3e,$3f - .byte $40,$41,$42,$43,$44,$45,$46,$47,$48,$49,$4a,$4b,$4c,$4d,$4e,$4f - .byte $50,$51,$52,$53,$54,$55,$56,$57,$58,$59,$5a,$5b,$5c,$5d,$5e,$5f - .byte $60,$61,$62,$63,$64,$65,$66,$67,$68,$69,$6a,$6b,$6c,$6d,$6e,$6f - .byte $70,$71,$72,$73,$74,$75,$76,$77,$78,$79,$7a,$7b,$7c,$7d,$7e + .enc sg_ascii + .text " !",$22,"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVW" + .text "XYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~" .byte $83 - .byte $a0,$a1,$a2,$a3,$a4,$a5,$a6,$a7,$a8,$a9,$aa,$ab,$ac,$ad,$ae,$af - .byte $b0,$b1,$b2,$b3,$b4,$b5,$b6,$b7,$b8,$b9,$ba,$bb,$bc,$bd,$be,$bf - .byte $c0,$c1,$c2,$c3,$c4,$c5,$c6,$c7,$c8,$c9,$ca,$cb,$cc,$cd,$ce,$cf - .byte $d0,$d1,$d2,$d3,$d4,$d5,$d6,$d7,$d8,$d9,$da,$db,$dc,$dd,$de,$df - .byte $e0,$e1,$e2,$e3,$e4,$e5,$e6,$e7,$e8,$e9,$ea,$eb,$ec,$ed,$ee,$ef - .byte $f0,$f1,$f2,$f3,$f4,$f5,$f6,$f7,$f8,$f9,$fa,$fb,$fc,$fd,$fe + .enc sg_hiascii + .text " !",$a2,"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVW" + .text "XYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~" .byte $83 + .enc none .text " !",$22,"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVW" .text "XYZ[" .byte $5c @@ -86,22 +107,21 @@ .byte $7d .byte $7e .byte $83 - .byte $20,$21,$22,$23,$24,$25,$26,$27,$28,$29,$2a,$2b,$2c,$2d,$2e,$2f - .byte $30,$31,$32,$33,$34,$35,$36,$37,$38,$39,$3a,$3b,$3c,$3d,$3e,$3f - .byte $00,$41,$42,$43,$44,$45,$46,$47,$48,$49,$4a,$4b,$4c,$4d,$4e,$4f - .byte $50,$51,$52,$53,$54,$55,$56,$57,$58,$59,$5a,$1b + .enc screen + .text " !",$22,"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVW" + .text "XYZ[" .byte $1c - .byte $1d + .byte ']' .byte $1e .byte $1f .byte $40 - .byte $01,$02,$03,$04,$05,$06,$07,$08,$09,$0a,$0b,$0c,$0d,$0e,$0f,$10 - .byte $11,$12,$13,$14,$15,$16,$17,$18,$19,$1a + .text "abcdefghijklmnopqrstuvwxyz" .byte $7b .byte $7c .byte $7d .byte $7e .byte $84 + .enc none .text "IICSTEP esrever" .byte $84 .null "null term PETSCII" @@ -115,16 +135,14 @@ .byte $84 .shift "pet dci" .byte $84 - .byte $05,$04,$0f,$43,$20,$0e,$05,$05,$12,$03,$53,$20,$05,$13,$12,$05 - .byte $16,$05,$12 + .enc screen + .text "edoC neercS esrever" .byte $84 - .byte $17,$53,$03,$12,$05,$05,$0e,$20,$43,$0f,$04,$05,$20,$17,$09,$14 - .byte $08,$20,$0c,$05,$0e,$07,$14,$08 + .ptext "Screen Code with length" .byte $84 - .byte $18,$00,$53,$03,$12,$05,$05,$0e,$20,$43,$0f,$04,$05,$20,$17,$09 - .byte $14,$08,$20,$0c,$05,$0e,$07,$14,$08,$32 + .text $18,$00,"Screen Code with length2" .byte $84 - .byte $53,$03,$12,$05,$05,$0e,$20,$43,$0f,$04,$05,$20,$44,$43,$c9 + .shift "Screen Code DCI" .byte $84 .byte $85 ;$00-ff block @@ -158,6 +176,7 @@ .byte $1b .byte $1c .byte $1d + .enc none .text $1e,$1f," !",$22,"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmno" .text "pqrstuvwxyz[" .byte $5c diff --git a/SourceGen/SGTestData/Expected/2018-char-encoding-s_64tass.S b/SourceGen/SGTestData/Expected/2018-char-encoding-s_64tass.S index 6894a54..3a51414 100644 --- a/SourceGen/SGTestData/Expected/2018-char-encoding-s_64tass.S +++ b/SourceGen/SGTestData/Expected/2018-char-encoding-s_64tass.S @@ -1,96 +1,113 @@ ;Project edited to mark some non-ASCII operands as ASCII. .cpu "65816" - .enc screen + .enc sg_hiascii + .cdef $20,$7e,$a0 + .enc sg_ascii + .cdef $20,$7e,$20 * = $1000 .as .xs clc xce sep #$30 - lda #$41 - lda #$c1 - lda #$c1 lda #'A' - ldx #$61 - ldx #$e1 - ldx #$41 + lda #'A' | $80 + .enc none + lda #'A' + .enc screen + lda #'A' + .enc sg_ascii ldx #'a' + ldx #'a' | $80 + .enc none + ldx #'a' + .enc screen + ldx #'a' + .enc sg_ascii lda #$7f lda #$7f + .enc none lda #$7f + .enc screen lda #$7f + .enc sg_ascii lda #$0d rep #$30 .al .xl - lda #$42 - lda #$c2 - lda #$c2 + lda #'B' + lda #'B' | $80 + .enc none + lda #'B' + .enc screen lda #'B' sep #$30 .as .xs rts - .byte $43 - .byte $c3 - .byte $c3 + .enc sg_ascii .byte 'C' - .word $64 - .word $e4 - .word $44 + .byte 'C' | $80 + .enc none + .byte 'C' + .enc screen + .byte 'C' + .enc sg_ascii + .word 'd' + .word 'd' | $80 + .enc none + .word 'd' + .enc screen .word 'd' .byte $00,$45 .byte $00,$c5 .byte $00,$c5 .byte $00,$45 .byte $80 - .byte $6c,$6f,$77,$20,$41,$53,$43,$49,$49,$20,$73,$74,$72 - .byte $e8,$e9,$e7,$e8,$a0,$c1,$d3,$c3,$c9,$c9,$a0,$f3,$f4,$f2 + .enc sg_ascii + .text "low ASCII str" + .enc sg_hiascii + .text "high ASCII str" .byte $80 - .byte $d0,$c5,$d4,$d3,$c3,$c9,$c9,$20,$53,$54,$52 + .enc none + .text "PETSCII str" .byte $80 + .enc screen .text "Screen Code str" .byte $82 - .byte $07,$4c,$6f,$77,$20,$41,$53,$43,$49,$49,$20,$43,$52,$4c,$46,$0d - .byte $0a + .enc sg_ascii + .text $07,"Low ASCII CRLF",$0d,$0a .byte $82 - .byte $87,$c8,$e9,$e7,$e8,$a0,$c1,$d3,$c3,$c9,$c9,$a0,$c3,$d2,$cc,$c6 - .byte $8d,$8a + .enc sg_hiascii + .text $87,"High ASCII CRLF",$8d,$8a .byte $82 - .byte $93,$d0,$c5,$d4,$d3,$c3,$c9,$c9,$20,$57,$49,$54,$48,$20,$96,$43 - .byte $4f,$4e,$54,$52,$4f,$4c,$05,$20,$43,$4f,$44,$45,$53,$0d + .enc none + .text $93,"PETSCII with ",$96,"control",$05," codes",$0d .byte $83 - .byte $20,$21,$22,$23,$24,$25,$26,$27,$28,$29,$2a,$2b,$2c,$2d,$2e,$2f - .byte $30,$31,$32,$33,$34,$35,$36,$37,$38,$39,$3a,$3b,$3c,$3d,$3e,$3f - .byte $40,$41,$42,$43,$44,$45,$46,$47,$48,$49,$4a,$4b,$4c,$4d,$4e,$4f - .byte $50,$51,$52,$53,$54,$55,$56,$57,$58,$59,$5a,$5b,$5c,$5d,$5e,$5f - .byte $60,$61,$62,$63,$64,$65,$66,$67,$68,$69,$6a,$6b,$6c,$6d,$6e,$6f - .byte $70,$71,$72,$73,$74,$75,$76,$77,$78,$79,$7a,$7b,$7c,$7d,$7e + .enc sg_ascii + .text " !",$22,"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVW" + .text "XYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~" .byte $83 - .byte $a0,$a1,$a2,$a3,$a4,$a5,$a6,$a7,$a8,$a9,$aa,$ab,$ac,$ad,$ae,$af - .byte $b0,$b1,$b2,$b3,$b4,$b5,$b6,$b7,$b8,$b9,$ba,$bb,$bc,$bd,$be,$bf - .byte $c0,$c1,$c2,$c3,$c4,$c5,$c6,$c7,$c8,$c9,$ca,$cb,$cc,$cd,$ce,$cf - .byte $d0,$d1,$d2,$d3,$d4,$d5,$d6,$d7,$d8,$d9,$da,$db,$dc,$dd,$de,$df - .byte $e0,$e1,$e2,$e3,$e4,$e5,$e6,$e7,$e8,$e9,$ea,$eb,$ec,$ed,$ee,$ef - .byte $f0,$f1,$f2,$f3,$f4,$f5,$f6,$f7,$f8,$f9,$fa,$fb,$fc,$fd,$fe + .enc sg_hiascii + .text " !",$a2,"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVW" + .text "XYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~" .byte $83 - .byte $20,$21,$22,$23,$24,$25,$26,$27,$28,$29,$2a,$2b,$2c,$2d,$2e,$2f - .byte $30,$31,$32,$33,$34,$35,$36,$37,$38,$39,$3a,$3b,$3c,$3d,$3e,$3f - .byte $40,$c1,$c2,$c3,$c4,$c5,$c6,$c7,$c8,$c9,$ca,$cb,$cc,$cd,$ce,$cf - .byte $d0,$d1,$d2,$d3,$d4,$d5,$d6,$d7,$d8,$d9,$da,$5b + .enc none + .text " !",$22,"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVW" + .text "XYZ[" .byte $5c - .byte $5d + .byte ']' .byte $5e .byte $5f .byte $60 - .byte $41,$42,$43,$44,$45,$46,$47,$48,$49,$4a,$4b,$4c,$4d,$4e,$4f,$50 - .byte $51,$52,$53,$54,$55,$56,$57,$58,$59,$5a + .text "abcdefghijklmnopqrstuvwxyz" .byte $7b .byte $7c .byte $7d .byte $7e .byte $83 + .enc screen .text " !",$22,"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVW" .text "XYZ[" .byte $1c @@ -104,26 +121,21 @@ .byte $7d .byte $7e .byte $84 - .byte $c9,$c9,$c3,$d3,$d4,$c5,$d0,$20,$45,$53,$52,$45,$56,$45,$52 + .enc none + .text "IICSTEP esrever" .byte $84 - .byte $4e,$55,$4c,$4c,$20,$54,$45,$52,$4d,$20,$d0,$c5,$d4,$d3,$c3,$c9 - .byte $c9,$00 + .null "null term PETSCII" .byte $84 - .byte $d4,$48,$49,$53,$20,$4e,$55,$4c,$4c,$2d,$54,$45,$52,$4d,$49,$4e - .byte $41,$54,$45,$44,$20,$53,$54,$52,$49,$4e,$47,$20,$49,$53,$20,$54 - .byte $4f,$4f,$20,$4c,$4f,$4e,$47,$20,$54,$4f,$20,$46,$49,$54,$20,$4f - .byte $4e,$20,$41,$20,$53,$49,$4e,$47,$4c,$45,$20,$4c,$49,$4e,$45,$2c - .byte $20,$41,$4e,$44,$20,$57,$49,$4c,$4c,$20,$42,$45,$20,$53,$50,$4c - .byte $49,$54,$2e,$00 + .text "This null-terminated string is too long to fit on a single lin" + .text "e, and will be split.",$00 .byte $84 - .byte $13,$d0,$c5,$d4,$d3,$c3,$c9,$c9,$20,$57,$49,$54,$48,$20,$4c,$45 - .byte $4e,$47,$54,$48 + .ptext "PETSCII with length" .byte $84 - .byte $14,$00,$d0,$c5,$d4,$d3,$c3,$c9,$c9,$20,$57,$49,$54,$48,$20,$4c - .byte $45,$4e,$47,$54,$48,$32 + .text $14,$00,"PETSCII with length2" .byte $84 - .byte $50,$45,$54,$20,$44,$43,$c9 + .shift "pet dci" .byte $84 + .enc screen .text "edoC neercS esrever" .byte $84 .ptext "Screen Code with length"