[cc65-devel] ONCE segment now compulsory for asm?
cc65 - a freeware C compiler for 6502 based systems
Brought to you by:
gpz
|
From: Stefan W. <swe...@em...> - 2016-05-17 04:09:52
|
Hi, I was just going to do something quick with assembly and cc65 when I discovered that what worked in a slightly older windows snapshot no longer works in the more recent snapshots. // This is using cc65 from an older windows snapshot In a file called main.asm I have only this: .proc main lda #65 jmp $ffd2 .endproc cl65 --version cl65 V2.14 - Git a13284a cl65 -tc64 main.asm -o main.c64 ld65: Warning: D:\Users\swessels\cc65\cfg/c64.cfg(40): Segment `STARTUP' does not exist ld65: Warning: D:\Users\swessels\cc65\cfg/c64.cfg(40): Segment `ZPSAVE' does not exist produces a working main.c64 with a basic stub (sys 2061). I am a bit surprised that the basic stub was added without me specifying anything such as .autoimport or a startup segment, but in this case, it's actually what I want and nice and user friendly. // This is using cc65 from the current windows snapshot cl65 --version cl65 V2.15 - Git b0e9294 cl65 -tc64 main.asm -o main.c64 ld65: Warning: d:\users\swessels\bin\cc65\cfg/c64.cfg(45): Segment `STARTUP' does not exist ld65: Warning: d:\users\swessels\bin\cc65\cfg/c64.cfg(45): Segment `INIT' does not exist ld65: Warning: d:\users\swessels\bin\cc65\cfg/c64.cfg(45): Segment `ONCE' does not exist ld65: Error: d:\users\swessels\bin\cc65\cfg/c64.cfg(15): Start address of memory area `BSS' is not constant As you can see, it produces a fatal error and no executable. The way to get the BSS error to go away is to add the ONCE segment, i.e. add the following line at the end of the file: .segment "ONCE" I guess it's just the way it is now, but it seems rather odd to me to have to do this? I suppose it has something to do with the default .cfg file changing and probably to it having this line: BSS: file = "", start = __ONCE_RUN__, size = __HIMEM__ - __STACKSIZE__ - __ONCE_RUN__; Perhaps the ONCE segment, or __ONCE_RUN__ could be inferred if it wasn't explicitly specified? All the best, Stefan |