mirror of
https://github.com/fadden/6502bench.git
synced 2024-09-10 13:54:52 +00:00
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)
162 lines
3.2 KiB
ArmAsm
162 lines
3.2 KiB
ArmAsm
.cpu "65816"
|
|
.enc "sg_ascii"
|
|
.cdef $20,$7e,$20
|
|
.logical $030000
|
|
.al
|
|
.xl
|
|
L30000 clc
|
|
xce
|
|
.as
|
|
.xs
|
|
sep #$30
|
|
lda L30000
|
|
nop
|
|
jsl _L23456
|
|
jsl _L80000
|
|
lda _L23456
|
|
lda _L23456 & $ffff
|
|
lda #<_L23456
|
|
lda #>_L23456
|
|
lda #`_L23456
|
|
lda _L80019
|
|
lda @w_L80019 & $ffff
|
|
lda #<_L80019
|
|
lda #>_L80019
|
|
lda #`_L80019
|
|
nop
|
|
rep #$30
|
|
.al
|
|
.xl
|
|
lda #_L80019 & $ffff
|
|
lda #_L80019 >> 8
|
|
lda #_L80019 >> 16
|
|
nop
|
|
lda #$000f
|
|
ldx #_L80026 & $ffff
|
|
ldy #_L23467 & $ffff
|
|
mvn #(`_L23467)+6,#`_L23467
|
|
nop
|
|
lda $0000,y
|
|
sta $0002,y
|
|
_L3004B pea $0000
|
|
pea $f000
|
|
pea _L80019 & $ffff
|
|
pea _L80019 >> 16
|
|
pea _L3004B & $ffff
|
|
pea _L3004B >> 8
|
|
_L3005D pea _L3004B >> 16
|
|
pea _L3005D & $ffff
|
|
pea $104b
|
|
nop
|
|
jmp _L30073
|
|
|
|
.word _L4FFE0 & $ffff
|
|
.long _L4FFE0
|
|
.long _L4FFE0
|
|
.byte $00
|
|
|
|
_L30073 phk
|
|
plb
|
|
lda #$0000
|
|
asl a
|
|
asl a
|
|
tax
|
|
lda @w_L30088 & $ffff,x
|
|
pha
|
|
lda @w_L30086 & $ffff,x
|
|
pha
|
|
beq _L3008E
|
|
rts
|
|
|
|
_L30086 .byte $4b
|
|
.byte $00
|
|
_L30088 .byte $03
|
|
.byte $00
|
|
.long _L30073
|
|
.byte $00
|
|
|
|
_L3008E rts
|
|
|
|
.here
|
|
.logical $04ffe0
|
|
_L4FFE0 .long _L4FFE0
|
|
.byte $00
|
|
.byte $00
|
|
.byte $01
|
|
.byte $02
|
|
.byte $03
|
|
.byte $04
|
|
.byte $05
|
|
.byte $06
|
|
.byte $07
|
|
.byte $08
|
|
.byte $09
|
|
.byte $0a
|
|
.byte $0b
|
|
.byte $0c
|
|
.byte $0d
|
|
.byte $0e
|
|
.byte $0f
|
|
.byte $10
|
|
.byte $11
|
|
.byte $12
|
|
.byte $13
|
|
.byte $14
|
|
.byte $15
|
|
.byte $16
|
|
.byte $17
|
|
.byte $18
|
|
.byte $19
|
|
.byte $1a
|
|
.byte $1b
|
|
.here
|
|
.logical $050000
|
|
.byte $1c
|
|
.byte $1d
|
|
.byte $1e
|
|
.byte $1f
|
|
.text " !",$22,"#$%&'()*+,-./"
|
|
|
|
.here
|
|
.logical $023456
|
|
.as
|
|
.xs
|
|
_L23456 lda _L23456
|
|
jsr _L23477
|
|
ldy #<_L23467
|
|
ora $3456
|
|
ora _L23456
|
|
rtl
|
|
|
|
_L23467 .fill 16,$00
|
|
|
|
_L23477 nop
|
|
rts
|
|
|
|
.here
|
|
.logical $080000
|
|
_L80000 lda _L80000
|
|
lda @w_L80019 & $ffff
|
|
nop
|
|
lda $010000
|
|
lda $020000
|
|
lda L30000
|
|
lda _L80000
|
|
rtl
|
|
|
|
_L80019 .long _L80019
|
|
.byte $00
|
|
.long _L23456
|
|
.byte $00
|
|
.byte $80
|
|
.byte $00
|
|
.byte $10
|
|
.byte $08
|
|
.byte $00
|
|
_L80026 .text "This is a test."
|
|
.byte $00
|
|
.here
|
|
.logical $060000
|
|
.text "hello, world!"
|
|
.here
|