What version of CC65 should this work with?

Are you new to 6502, NES, or even programming in general? Post any of your questions here. Remember - the only dumb question is the question that remains unasked.

Moderator: Moderators

the_doctor
Posts: 31
Joined: Tue May 24, 2016 7:54 am

What version of CC65 should this work with?

Post by the_doctor »

Just a quick question, when compiling with CC65 (v2.15 - the latest windows snapshot) I'm getting unknown pragma errors ("WARNING: Unknown pragma 'bss' ") for the following:

Code: Select all

#pragma bss-name (push,"ZEROPAGE")
I can't seem to find a straight answer to this by searching. Is this a version issue, and if so what version of CC65 should recognize a pragma like this?
Last edited by the_doctor on Sat May 28, 2016 8:47 pm, edited 1 time in total.
User avatar
rainwarrior
Posts: 8062
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: What version of CC65 should this work with?

Post by rainwarrior »

I don't know the version history or when that feature was added, but you can get a more recent version at CC65's current website:

http://cc65.github.io/cc65/

Documentation on pragmas is available on that same site:

http://cc65.github.io/doc/cc65.html#s7

It looks like the last version on the old website called that pramga bssseg instead. Don't ask me why they changed the name, or why it's not backward compatible. Fear of too many Ses in one place?

http://www.cc65.org/doc/cc65-7.html#s7 (old)
the_doctor
Posts: 31
Joined: Tue May 24, 2016 7:54 am

Re: What version of CC65 should this work with?

Post by the_doctor »

But I have the latest version from there (v2.15 - the latest windows snapshot) and cc65 still complains about that pragma unless I change it to

Code: Select all

#pragma bssseg (push,"ZEROPAGE")
the_doctor
Posts: 31
Joined: Tue May 24, 2016 7:54 am

Re: What version of CC65 should this work with?

Post by the_doctor »

Checking the versions of a few things yields the following:
Attachments
Versions.png
User avatar
freem
Posts: 168
Joined: Mon Oct 01, 2012 3:47 pm
Location: freemland (NTSC-U)
Contact:

Re: What version of CC65 should this work with?

Post by freem »

7845f1b is the absolute latest version at the time of me writing this post.

After performing a blame check, it looks like bssseg became obsolete and bss-name became the preferred method back in 2009: https://github.com/cc65/cc65/commit/ed2 ... 126de6f517

I can't particularly pinpoint an exact version, but hopefully this will narrow it down some.
the_doctor
Posts: 31
Joined: Tue May 24, 2016 7:54 am

Re: What version of CC65 should this work with?

Post by the_doctor »

Thanks for clarifying. So I'm confused as to why I'm getting this unknown pragma error for bss-name considering I have the latest version.
the_doctor
Posts: 31
Joined: Tue May 24, 2016 7:54 am

Re: What version of CC65 should this work with?

Post by the_doctor »

I did at one point install an old version of cc65, but I've replaced all those old files with the latest windows snapshot (hence why cl65 --version reports that I do have the latest version). But I wonder if that old install is still causing problems somehow...
User avatar
rainwarrior
Posts: 8062
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: What version of CC65 should this work with?

Post by rainwarrior »

I tried:

Code: Select all

#pragma bss-name (push,"ZEROPAGE")
in a couple of different versions of CC65 that I have, including the newest one, and don't see any problems.

Maybe there is something weird going on with your text encoding? Is that - a real -, or...?
the_doctor
Posts: 31
Joined: Tue May 24, 2016 7:54 am

Re: What version of CC65 should this work with?

Post by the_doctor »

not sure what you mean by real - but yeah its a dash. Typed in like #pragma bss-name
User avatar
rainwarrior
Posts: 8062
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: What version of CC65 should this work with?

Post by rainwarrior »

Well, the warning should be Unknown pragma 'bss-name' if it doesn't recognize it (e.g. I could change it to "css-name" and that's exactly the term it would spit back). It seems very strange that it would say just bss, which is why I wondered if there is something weird about your hyphen.
User avatar
thefox
Posts: 3139
Joined: Mon Jan 03, 2005 10:36 am
Location: Tampere, Finland
Contact:

Re: What version of CC65 should this work with?

Post by thefox »

If you have an old installation lying around, first thing I'd verify is that Make is not picking it up for some reason. You can try replacing the "cl65 ..." command in the Makefile with "cl65 --version", make, and see if it spits out the version you expect.
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: fo.aspekt.fi
User avatar
dougeff
Posts: 2875
Joined: Fri May 08, 2015 7:17 pm
Location: DIGDUG
Contact:

Re: What version of CC65 should this work with?

Post by dougeff »

I recall having a similar problem when I had two different versions of cc65 on my computer, I even wrote about it here in the forum...
viewtopic.php?f=22&t=13171&p=154086#p154086

The solution was to uninstall the old version. I know you said you did that, so IDK.
nesdoug.com -- blog/tutorial on programming for the NES
User avatar
dougeff
Posts: 2875
Joined: Fri May 08, 2015 7:17 pm
Location: DIGDUG
Contact:

Re: What version of CC65 should this work with?

Post by dougeff »

Here's another thought. Search your computer for cl65, and make sure that the installer didn't make a copy in your Program Files folder...a copy of the older version, that somehow is still in your 'paths'.
nesdoug.com -- blog/tutorial on programming for the NES
the_doctor
Posts: 31
Joined: Tue May 24, 2016 7:54 am

Re: What version of CC65 should this work with?

Post by the_doctor »

In any case I seem to have resolved the issue by performing a system restore to before I installed the old CC65 :)

BUT now the compiler says "ld65: Error: Missing memory area assignment for segment 'ONCE' "

I don't know what that memory segment is, has anyone seen this before?
User avatar
dougeff
Posts: 2875
Joined: Fri May 08, 2015 7:17 pm
Location: DIGDUG
Contact:

Re: What version of CC65 should this work with?

Post by dougeff »

That's an easy one. Your linker file (.cfg) defines a memory segment called 'ONCE', and none of your other files used it. Either change your linker file to exclude it (or maybe add the words 'optional = yes' (? not certain?))...or, just slap a quick .segment "ONCE" anywhere in any ASM file...even with no contents, should resove the issue.

Edit...wait, I think it's the other way around... one of your files calls for a .segment "ONCE", but your linker file didn't define it. Either way, change the linker file (.cfg).
nesdoug.com -- blog/tutorial on programming for the NES
Post Reply