1
0
mirror of https://github.com/fadden/6502bench.git synced 2024-10-31 19:04:44 +00:00
6502bench/SourceGen/SGTestData/Expected/2022-extension-scripts_cc65.S
Andy McFadden 28eafef27c Expand the set of things SetInlineDataFormat accepts
Extension scripts (a/k/a "plugins") can now apply any data format
supported by FormatDescriptor to inline data.  In particular, it can
now handle variable-length inline strings.  The code analyzer
verifies the string structure (e.g. null-terminated strings have
exactly one null byte, at the very end).

Added PluginException to carry an exception back to the plugin code,
for occasions when they're doing something so wrong that we just
want to smack them.

Added test 2022-extension-scripts to exercise the feature.
2019-10-05 19:51:34 -07:00

59 lines
1.3 KiB
ArmAsm

.setcpu "65816"
PrintInlineL1String = $011000
PrintInlineL2String = $012000
PrintInlineDciString = $013000
; .segment "SEG000"
.org $1000
.a8
.i8
clc
xce
sep #$30
jsr PrintInline8String
.byte "01234567"
jsr PrintInlineRev8String
.byte "76543210"
jsr PrintInlineNullString
.asciiz "null-term string"
jsl PrintInlineL1String
.byte $14,"string with length/1"
jsl PrintInlineL2String
.byte $14,$00,"string with length/2"
jsl PrintInlineDciString
.byte "DCI strin",$e7
jsr L107C
jsr L110F
jsr L1108
rts
PrintInline8String: rts
PrintInlineRev8String: rts
PrintInlineNullString: rts
L107C: jsr PrintInlineNullString
per $7ff4
rtl
.byte $65
.byte $6e
.byte $20
.byte $01
; .segment "SEG001"
.org $1100
.byte "string"
.byte $00
.byte $60
L1108: jsl PrintInlineL2String
asl A
brk
.byte $60
L110F: jsr PrintInlineNullString
adc $6e
.byte $64