mirror of
https://github.com/fadden/6502bench.git
synced 2024-07-14 05:28:55 +00:00
ACME has a "real" PC and a "pseudo" PC. The "real" PC determines the initial position in a 64KB buffer used to hold assembler output. If the amount of code generated runs off the end, the assembler fails with "produced too much code". The source code generator in SourceGen was outputting a "real" PC for the first address range and "psuedo" PCs for any address ranges that followed. This produced nice results for code with a single range, but caused problems for multi-range sources if the initial range was high in memory and a later range was lower in memory. While the assembler isn't actually generating more than 64KB of code, ACME's buffer management was detecting an overflow. Now, if a source file has multiple address ranges, we set the "real" PC to $0000 and use a "pseudo" PC for all ranges. Output for projects with a single address range is unmodified.
26 lines
531 B
ArmAsm
26 lines
531 B
ArmAsm
!cpu 6502
|
|
* = $0000
|
|
!pseudopc $2000 {
|
|
jmp L2100
|
|
|
|
!text "hello, " ;string should be split by no-op addr change
|
|
} ;!pseudopc
|
|
!pseudopc $200a {
|
|
!text "world"
|
|
!byte $80
|
|
|
|
} ;!pseudopc
|
|
!pseudopc $2100 {
|
|
L2100 lda #$00
|
|
sta addr1-1 ;edit this operand
|
|
sta addr1
|
|
sta addr1+1
|
|
jmp L2121
|
|
|
|
!text "testing stuff."
|
|
addr1 !text "!?---"
|
|
|
|
L2121 rts
|
|
|
|
} ;!pseudopc
|