1
0
mirror of https://github.com/fadden/6502bench.git synced 2024-07-20 12:28:58 +00:00
6502bench/SourceGen/SGTestData/Expected/1003-flags-and-branches_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

261 lines
3.9 KiB
ArmAsm

.cpu "65816"
* = $1000
.as
.xs
clc
xce
sep #$ff
clv
cld
cli
clc
lda #$80
lda #$01
sed
sei
sec
lda #$ff
adc #$00
sep #$ff
rep #$80
rep #$40
rep #$20
.al
rep #$10
.xl
rep #$08
rep #$04
rep #$02
rep #$01
sep #$00
sep #$ff
.as
.xs
rep #$00
rep #$ff
.al
.xl
lda #$feed
sec
xce
.as
.xs
lda #$ff
rep #$30
lda #$ff
clc
xce
lda #$ff
rep #$20
.al
sep #$10
lda #$0000
ldx #$01
ldy #$02
sep #$20
.as
rep #$10
.xl
lda #$01
ldx #$0000
ldy #$0000
sep #$30
.xs
lda #$00
pha
plp
rep #$80
bpl L105F
.byte $00
.byte $00
L105F sep #$80
bpl L1065
bmi L1067
L1065 .byte $00
.byte $00
L1067 rep #$40
bvc L106D
.byte $00
.byte $00
L106D sep #$40
bvs L1073
.byte $00
.byte $00
L1073 rep #$01
bcc L1079
.byte $00
.byte $00
L1079 sep #$01
bcs L107F
.byte $00
.byte $00
L107F rep #$02
bne L1085
.byte $00
.byte $00
L1085 sep #$02
beq L108B
.byte $00
.byte $00
L108B sep #$ff
lda #$01
bne L1093
.byte $00
.byte $db
L1093 lda #$00
beq L1099
.byte $00
.byte $db
L1099 bpl L109D
.byte $00
.byte $db
L109D lda #$80
bmi L10A3
.byte $00
.byte $db
L10A3 lda #$ff
and #$00
beq L10AB
.byte $00
.byte $db
L10AB lda #$00
and #$ff
beq L10B3
.byte $00
.byte $db
L10B3 lda #$ff
and #$7f
bne L10BB
.byte $00
.byte $db
L10BB bpl L10BF
.byte $00
.byte $db
L10BF lda #$ff
and #$80
bmi L10C7
.byte $00
.byte $db
L10C7 lda #$00
ora #$00
beq L10CF
.byte $00
.byte $db
L10CF ora #$01
bne L10D5
.byte $00
.byte $db
L10D5 lda #$00
ora #$7f
bpl L10DD
.byte $00
.byte $db
L10DD ora #$80
bmi L10E3
.byte $00
.byte $db
L10E3 lda L10E3
sec
ror a
bmi L10EC
.byte $00
.byte $dc
L10EC clc
ror a
bpl L10F2
.byte $00
.byte $dc
L10F2 lda #$00
sec
rol a
bne L10FA
.byte $00
.byte $dc
L10FA clc
php
sec
plp
bcc L1102
.byte $00
.byte $00
L1102 rep #$20
.al
sep #$10
jsr L111D
rep #$30
.xl
jsr L1123
sep #$30
.as
.xs
jsr L1123
rep #$20
.al
sep #$10
jsr L111D
sep #$30
.as
rts
.al
L111D lda #$1234
ldx #$ff
rts
.as
L1123 lda #$ff
ldx #$ee
ldy #$dd
rts