1
0
mirror of https://github.com/fadden/6502bench.git synced 2024-11-19 06:31:02 +00:00
6502bench/SourceGen/SGTestData/Expected/2006-operand-formats_64tass.S
Andy McFadden 32d1147eec Improve multi-encoding output in 64tass
Previously, we used the default character encoding from the project
properties to determine how strings and character constants in the
entire source file should be encoded.  Now we switch between
encodings as needed.  The default character encoding is no longer
relevant.

High ASCII is now an actual encoding, rather than acting like ASCII
that sometimes doesn't work.  Because we can do high ASCII character
operands with "| $80", we don't output a .enc to switch from ASCII
to high ASCII unless we need to generate a string.  (If we're
already in high ASCII mode, the "| $80" isn't required but won't
hurt anything.)

We now do a scan up front to see if ASCII or high ASCII is needed,
and only output the .cdefs for the encodings that are actually used.

The only gap in the matrix is high ASCII DCI strings -- the ".shift"
pseudo-op rejects text if the string doesn't start with the high
bit clear.
2019-08-21 13:46:05 -07:00

74 lines
1.6 KiB
ArmAsm

;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
.as
.xs
clc
xce
sep #$30
lda $01
lda $0102
lda $010203
lda 1
lda 258
lda 66051
lda %00000001
lda %0000000100000010
lda %000000010000001000000011
bra skipdata
.byte $01
.word $0201
.long $030201
.dword $04030201
.byte 1
.word 513
.long 197121
.dword 67305985
.byte %00000001
.word %0000001000000001
.long %000000110000001000000001
.dword %00000100000000110000001000000001
skipdata lda #'h'
lda 'h'
lda @w'h'
lda @l'h'
lda #$1f
lda #' '
lda #'"'
lda #$27
lda #'~'
lda #$7f
lda #$80
lda #$9f
lda #' ' | $80
lda #'"' | $80
lda #$a7
lda #'~' | $80
lda #$ff
rep #'0'
.al
.xl
lda #'h'
lda #'H' | $80
lda #$6868
rts
more_ascii .byte 'h'
.byte $80
.word $6868
.byte $80
.word skipdata
.long skipdata
.byte $10,$3f
.byte <more_ascii
.byte >more_ascii
.word more_ascii
.long more_ascii
.byte $10,$70