2018-10-24 21:57:09 +00:00
|
|
|
;Project was edited to add a label in the middle of a dense hex region, and add
|
|
|
|
;a duplicate label.
|
|
|
|
.cpu "65816"
|
2020-07-02 15:14:42 +00:00
|
|
|
.enc "sg_ascii"
|
2019-08-20 18:21:30 +00:00
|
|
|
.cdef $20,$7e,$20
|
2020-01-18 02:29:20 +00:00
|
|
|
BMI1 = $30 ;opcode mnemonic
|
2018-10-24 21:57:09 +00:00
|
|
|
zip = $cd
|
|
|
|
absl = $1029
|
|
|
|
absh = $feed
|
|
|
|
biggie = $123456
|
|
|
|
thirty2 = $12345678 ;32-bit constant test
|
2019-10-23 05:43:10 +00:00
|
|
|
|
2019-10-10 20:49:21 +00:00
|
|
|
plataddr = $3000 ;address only in platform file
|
|
|
|
projalsa = $3200 ;same val as projalso
|
2018-10-24 21:57:09 +00:00
|
|
|
|
Fix 64tass output for non-loadable files
64tass wants to place its output into a 64KB region of memory,
starting at the address "*" is set to, and continuing without
wrapping around the end of the bank. Some files aren't meant to be
handled that way, so we need to generate the output differently.
If the file's output fits nicely, it's considered "loadable", and
is generated in the usual way. If it doesn't, it's treated as
"streamable", and the initial "* = addr" directive is omitted
(leaving "*" at zero), and we go straight to ".logical" directives.
65816 code with an initial address outside bank 0 is treated as
"streamable" whether or not the contents fit nicely in the designated
64K area. This caused a minor change to a few of the 65816 tests.
A new test, 20240-large-overlay, exercises "streamable" by creating
a file with eight overlapping 8KB segments that load at $8000.
While the file as a whole fits in 64KB, it wouldn't if loaded at
the desired start address.
Also, updated the regression test harness to report assembler
failure independently of overall test failure. This makes it easier
to confirm that (say) ACME v0.96.4 still works with the code we
generate, even though it doesn't match the expected output (which
was generated for v0.97).
(problem was raised in issue #98)
2021-08-02 00:09:52 +00:00
|
|
|
.logical $012345
|
2018-10-24 21:57:09 +00:00
|
|
|
.as
|
|
|
|
.xs
|
|
|
|
start clc
|
|
|
|
xce
|
|
|
|
sep #$30
|
|
|
|
lda #zip
|
|
|
|
lda #zip+16
|
|
|
|
lda #zip-192
|
|
|
|
lda #<absh
|
|
|
|
lda #>absh
|
|
|
|
lda #<absh-192
|
|
|
|
lda #(>absh)+1
|
|
|
|
lda #<absl
|
|
|
|
lda #>absl
|
|
|
|
lda #<absl+192
|
|
|
|
lda #(>absl)-1
|
|
|
|
lda #<start
|
|
|
|
lda #>start
|
|
|
|
lda #`start
|
|
|
|
pea $feed
|
2020-07-02 20:00:02 +00:00
|
|
|
pea start & $ffff
|
2018-10-24 21:57:09 +00:00
|
|
|
pea $0001
|
|
|
|
pea $3456
|
|
|
|
pea $0012
|
|
|
|
pea absh
|
2020-07-02 20:00:02 +00:00
|
|
|
pea start & $ffff
|
|
|
|
pea start >> 16
|
|
|
|
pea biggie & $ffff
|
|
|
|
pea biggie >> 16
|
2018-10-24 21:57:09 +00:00
|
|
|
lda zip+1
|
|
|
|
lda @wzip+1
|
|
|
|
lda @lzip+1
|
|
|
|
lda absh-1
|
|
|
|
lda @labsh-1
|
|
|
|
lda absh+1
|
|
|
|
lda @labsh+1
|
|
|
|
lda 0+(start & $ffff)+1
|
|
|
|
lda start+1
|
|
|
|
lda 0+(start & $ffff)-1
|
|
|
|
lda start-1
|
|
|
|
lda 0+(biggie & $ffff)+1
|
|
|
|
lda biggie+1
|
|
|
|
lda 0+(biggie & $ffff)-1
|
|
|
|
lda biggie-1
|
|
|
|
rep #$30
|
|
|
|
.al
|
|
|
|
.xl
|
|
|
|
lda #zip
|
|
|
|
lda #zip+16
|
|
|
|
lda #zip+64
|
|
|
|
lda #absl
|
2020-07-02 20:00:02 +00:00
|
|
|
lda #absl >> 8
|
2020-01-02 21:09:18 +00:00
|
|
|
lda #absl-$1000
|
2018-10-26 22:45:39 +00:00
|
|
|
lda #(absl >> 8)-16
|
2020-07-02 20:00:02 +00:00
|
|
|
lda #absl >> 16
|
2018-10-24 21:57:09 +00:00
|
|
|
lda #absh
|
2020-07-02 20:00:02 +00:00
|
|
|
lda #absh >> 8
|
2020-01-02 21:09:18 +00:00
|
|
|
lda #absh-$f000
|
2018-10-26 22:45:39 +00:00
|
|
|
lda #(absh >> 8)+16
|
|
|
|
lda #(absh >> 16)+1
|
2020-07-02 20:00:02 +00:00
|
|
|
lda #start & $ffff
|
|
|
|
lda #start >> 8
|
|
|
|
lda #start >> 16
|
|
|
|
lda #biggie & $ffff
|
|
|
|
lda #biggie >> 8
|
|
|
|
lda #biggie >> 16
|
2019-11-17 01:15:03 +00:00
|
|
|
bra _skipdata
|
2018-10-24 21:57:09 +00:00
|
|
|
|
|
|
|
.byte zip
|
|
|
|
.byte <absh
|
|
|
|
.byte >absh
|
|
|
|
.byte <start
|
|
|
|
.byte >start
|
|
|
|
.byte `start
|
|
|
|
.word zip
|
|
|
|
.word absl
|
2020-07-02 20:00:02 +00:00
|
|
|
.word absl >> 8
|
2020-01-02 21:09:18 +00:00
|
|
|
.word absl-$1000
|
2018-10-24 21:57:09 +00:00
|
|
|
.word 0+(absl >> 8)-16
|
|
|
|
.word absh
|
2020-07-02 20:00:02 +00:00
|
|
|
.word absh >> 8
|
2020-01-02 21:09:18 +00:00
|
|
|
.word absh-$f000
|
2018-10-24 21:57:09 +00:00
|
|
|
.word 0+(absh >> 8)+16
|
2020-07-02 20:00:02 +00:00
|
|
|
.word start & $ffff
|
|
|
|
.word start >> 8
|
|
|
|
.word start >> 16
|
2018-10-24 21:57:09 +00:00
|
|
|
.word 0+(start & $ffff)+1
|
2020-07-02 20:00:02 +00:00
|
|
|
.word start >> 8
|
|
|
|
.word start >> 16
|
2018-10-24 21:57:09 +00:00
|
|
|
.byte $fe,$ed
|
|
|
|
.long zip
|
|
|
|
.long absh
|
2020-07-02 20:00:02 +00:00
|
|
|
.long absh >> 8
|
2018-10-24 21:57:09 +00:00
|
|
|
.long start
|
2020-07-02 20:00:02 +00:00
|
|
|
.long start >> 8
|
|
|
|
.long start >> 16
|
2018-10-24 21:57:09 +00:00
|
|
|
.dword zip
|
|
|
|
.dword absh
|
2020-07-02 20:00:02 +00:00
|
|
|
.dword absh >> 8
|
2018-10-24 21:57:09 +00:00
|
|
|
.dword start-1
|
2020-07-02 20:00:02 +00:00
|
|
|
.dword start >> 8
|
|
|
|
.dword start >> 16
|
2018-10-24 21:57:09 +00:00
|
|
|
|
2019-11-17 01:15:03 +00:00
|
|
|
_skipdata lda #(biggie >> 16)-1
|
2019-08-08 20:02:01 +00:00
|
|
|
mvn #`biggie,#(`biggie)-17
|
|
|
|
mvp #`start,#(`start)+17
|
|
|
|
mvn #18,#1
|
|
|
|
mvp #%00000001,#%00010010
|
2019-11-17 01:15:03 +00:00
|
|
|
per _skipdata
|
|
|
|
brl _nextchunk
|
2018-10-24 21:57:09 +00:00
|
|
|
|
2019-11-17 01:15:03 +00:00
|
|
|
_nextchunk jml _L1000_1
|
2018-10-24 21:57:09 +00:00
|
|
|
|
Fix 64tass output for non-loadable files
64tass wants to place its output into a 64KB region of memory,
starting at the address "*" is set to, and continuing without
wrapping around the end of the bank. Some files aren't meant to be
handled that way, so we need to generate the output differently.
If the file's output fits nicely, it's considered "loadable", and
is generated in the usual way. If it doesn't, it's treated as
"streamable", and the initial "* = addr" directive is omitted
(leaving "*" at zero), and we go straight to ".logical" directives.
65816 code with an initial address outside bank 0 is treated as
"streamable" whether or not the contents fit nicely in the designated
64K area. This caused a minor change to a few of the 65816 tests.
A new test, 20240-large-overlay, exercises "streamable" by creating
a file with eight overlapping 8KB segments that load at $8000.
While the file as a whole fits in 64KB, it wouldn't if loaded at
the desired start address.
Also, updated the regression test harness to report assembler
failure independently of overall test failure. This makes it easier
to confirm that (say) ACME v0.96.4 still works with the code we
generate, even though it doesn't match the expected output (which
was generated for v0.97).
(problem was raised in issue #98)
2021-08-02 00:09:52 +00:00
|
|
|
.here
|
2018-10-24 21:57:09 +00:00
|
|
|
.logical $1000
|
2019-11-17 01:15:03 +00:00
|
|
|
_L1000_1 nop
|
|
|
|
_L1000 nop
|
|
|
|
_L1000_0 nop
|
|
|
|
_l1000 sep #$30
|
2018-10-24 21:57:09 +00:00
|
|
|
.as
|
|
|
|
.xs
|
|
|
|
lda plataddr
|
|
|
|
lda $3100
|
|
|
|
lda projalsa
|
|
|
|
lda $3300
|
2019-11-17 01:15:03 +00:00
|
|
|
bra _calls
|
2018-10-24 21:57:09 +00:00
|
|
|
|
|
|
|
nop
|
2019-11-17 01:15:03 +00:00
|
|
|
_targ nop
|
2018-10-24 21:57:09 +00:00
|
|
|
nop
|
2019-11-17 01:15:03 +00:00
|
|
|
_L1016 per _targ-1
|
|
|
|
per _targ
|
|
|
|
per _targ+1
|
|
|
|
jsr _targ-1
|
|
|
|
jsr _targ
|
|
|
|
jsr _targ+1
|
|
|
|
_L1028 bra _targ-1
|
2018-10-24 21:57:09 +00:00
|
|
|
|
2019-11-17 01:15:03 +00:00
|
|
|
_L102A bra _targ
|
2018-10-24 21:57:09 +00:00
|
|
|
|
2019-11-17 01:15:03 +00:00
|
|
|
_L102C bra _targ+1
|
2018-10-24 21:57:09 +00:00
|
|
|
|
2019-11-17 01:15:03 +00:00
|
|
|
_L102E brl _targ-1
|
2018-10-24 21:57:09 +00:00
|
|
|
|
2019-11-17 01:15:03 +00:00
|
|
|
_L1031 brl _targ
|
2018-10-24 21:57:09 +00:00
|
|
|
|
2019-11-17 01:15:03 +00:00
|
|
|
_L1034 brl _targ+1
|
2018-10-24 21:57:09 +00:00
|
|
|
|
2019-11-17 01:15:03 +00:00
|
|
|
_L1037 jmp _targ-1
|
2018-10-24 21:57:09 +00:00
|
|
|
|
2019-11-17 01:15:03 +00:00
|
|
|
_L103A jmp _targ
|
2018-10-24 21:57:09 +00:00
|
|
|
|
2019-11-17 01:15:03 +00:00
|
|
|
_L103D jmp _targ+1
|
2018-10-24 21:57:09 +00:00
|
|
|
|
2019-11-17 01:15:03 +00:00
|
|
|
_L1040 jml _targ-1
|
2018-10-24 21:57:09 +00:00
|
|
|
|
2019-11-17 01:15:03 +00:00
|
|
|
jml _targ
|
2018-10-24 21:57:09 +00:00
|
|
|
|
2019-11-17 01:15:03 +00:00
|
|
|
jml _targ+1
|
2018-10-24 21:57:09 +00:00
|
|
|
|
2019-11-17 01:15:03 +00:00
|
|
|
_calls jsr _L1016
|
|
|
|
jsr _L1028
|
|
|
|
jsr _L102A
|
|
|
|
jsr _L102C
|
|
|
|
jsr _L102E
|
|
|
|
jsr _L1031
|
|
|
|
jsr _L1034
|
|
|
|
jsr _L1037
|
|
|
|
jsr _L103A
|
|
|
|
jsr _L103D
|
|
|
|
jsr _L1040
|
2018-10-24 21:57:09 +00:00
|
|
|
jsr $1044
|
|
|
|
jsr $1048
|
2019-11-17 01:15:03 +00:00
|
|
|
brl _L118E
|
2018-10-24 21:57:09 +00:00
|
|
|
|
2019-11-17 01:15:03 +00:00
|
|
|
_bulk .byte $80,$81,$82,$83,$84,$85,$86,$87,$88,$89,$8a,$8b,$8c,$8d,$8e,$8f ;bulky
|
2018-10-24 21:57:09 +00:00
|
|
|
.byte $80,$81,$82,$83,$84,$85,$86,$87,$88,$89,$8a,$8b,$8c,$8d,$8e,$8f
|
|
|
|
.byte $80,$81,$82,$83,$84,$85,$86,$87,$88,$89,$8a,$8b,$8c,$8d,$8e,$8f
|
|
|
|
.byte $80,$81,$82,$83,$84,$85,$86,$87,$88,$89,$8a,$8b,$8c,$8d,$8e,$8f
|
|
|
|
.byte $80,$81,$82,$83,$84,$85,$86,$87,$88,$89,$8a,$8b,$8c,$8d,$8e,$8f
|
|
|
|
.byte $80,$81,$82,$83,$84,$85,$86,$87,$88,$89,$8a,$8b,$8c,$8d,$8e,$8f
|
|
|
|
.byte $80,$81,$82,$83,$84,$85,$86,$87,$88,$89,$8a,$8b,$8c,$8d,$8e,$8f
|
2019-11-17 01:15:03 +00:00
|
|
|
_string .text "This is a long string. Put a label and comment on it to confir" ;stringy
|
2018-10-24 21:57:09 +00:00
|
|
|
.text "m that the label and comment only appear on the first line. T"
|
|
|
|
.text "he quick brown fox jumps over the lazy dogs."
|
|
|
|
|
2019-11-17 01:15:03 +00:00
|
|
|
_L118E lda #<thirty2+2
|
2018-10-24 21:57:09 +00:00
|
|
|
lda #(>thirty2)+3
|
|
|
|
lda #`thirty2
|
2020-01-18 02:29:20 +00:00
|
|
|
rep #BMI1
|
2018-10-24 21:57:09 +00:00
|
|
|
.al
|
|
|
|
.xl
|
2018-10-26 22:45:39 +00:00
|
|
|
lda #(thirty2 & $ffff)+3
|
|
|
|
lda #((thirty2 >> 8) & $ffff)+4
|
2020-07-02 20:00:02 +00:00
|
|
|
lda #thirty2 >> 16
|
2018-10-24 21:57:09 +00:00
|
|
|
rts
|
|
|
|
|
|
|
|
.here
|