Page 3 of 4

Re: SDCC for 6502

Posted: Tue Jun 06, 2023 7:40 am
by GlennSmith
Hi,
It would be nice to have a 65c02 cross-compiler that didn't have to be forced to run under wine on linux machines(*). Is anybody able to liase with the SDCC dev. group to provide feedback about the "peculiarities" of the 6502/65c02 instructions and architecture?*

I'd offer to help, but I'm very *VERY* rusty at the moment - I still develop more on PIC/ATMega microcontrollers than the 6502. The SBC that I built back in the 90's was not at all reliable, and I've since lost the schematics and the board (all went with the rusty Atom to the great museum in the sky...).
I naively (spelling ? sorry if it's wrong) thought that when I retired I'd have time to play : so far it's not the case.

Could we perhaps work together, for example I could run tests and interface with the dev group, if one or two of you that are able to provide the expertise on what could be added or improved could check over the final results of the tests.

(*) after having supported a factory with 600 Windows machines for decades, I vowed never to use uSoft again. I almost manage, I have an old Win95 laptop just for my 3D architecture suite. Everything else has been on linux for over 10yrs now.
Please provide f/b. Regards, Glenn from France.

Re: SDCC for 6502

Posted: Tue Jun 06, 2023 9:46 am
by Proxy
GlennSmith wrote:
Hi,
It would be nice to have a 65c02 cross-compiler that didn't have to be forced to run under wine on linux machinesce.
What about cc65? It runs natively on linux.

Re: SDCC for 6502

Posted: Tue Jun 06, 2023 12:47 pm
by drogon
Proxy wrote:
GlennSmith wrote:
Hi,
It would be nice to have a 65c02 cross-compiler that didn't have to be forced to run under wine on linux machinesce.
What about cc65? It runs natively on linux.
Seconded for cc65 and the rest of the suite - I use the assembler on a near daily basis and while I've not used the C compiler for a while I'm looking at it again for some things in the near future.

-Gordon

Re: SDCC for 6502

Posted: Tue Jun 06, 2023 3:41 pm
by GlennSmith
Proxy wrote:
GlennSmith wrote:
Hi,
It would be nice to have a 65c02 cross-compiler that didn't have to be forced to run under wine on linux machinesce.
What about cc65? It runs natively on linux.
Well, some flavours of Linux... I'm a Mint user (over an Ubuntu core) - I'll have to see if I can MAKE something from the source repository.

I do have an old Win version that works, but it's a hassle to run under wine. I'll see what I can do.
Thanks

Re: SDCC for 6502

Posted: Tue Jun 06, 2023 4:52 pm
by Proxy
now i'm a bit confused why you would need to build it yourself.
i thought mint is based on ubuntu, in which case you shouldn't you be able to just do "sudo apt install cc65" in a terminal and have it work? (or even get an IDE like VScode and install the cc65 plugin for it in the UI)

for the record i did try "sudo apt install cc65" on my WSL install of ubuntu and it does actually work without having to build it manually.

Re: SDCC for 6502

Posted: Tue Jun 06, 2023 5:52 pm
by Yuri
I was able to get it compile just fine under Ubuntu under my WSL environment.

They provide binaries for Windows, Linux and Mac OS on their daily builds if you don't want to build yourself:

https://sdcc.sourceforge.net/snap.php

Re: SDCC for 6502

Posted: Tue Jun 06, 2023 9:25 pm
by drogon
GlennSmith wrote:
Hi,
It would be nice to have a 65c02 cross-compiler that didn't have to be forced to run under wine on linux machinesce.
What about cc65? It runs natively on linux.r/> Well, some flavours of Linux... I'm a Mint user (over an Ubuntu core) - I'll have to see if I can MAKE something from the source repository.

I do have an old Win version that works, but it's a hassle to run under wine. I'll see what I can do.
Thanks

It's a standard package under Debian and Devuan (which is what I mostly use now), so no reason to think it's not there for other flavours.

However I compiled it from scratch for myself as it's the only way to add a new system into it. I don't recall any issues there. It's nothing special, no GUI, no fancy networking or other stuff needed. It's just another C program...

-Gordon

Re: SDCC for 6502

Posted: Wed Jun 07, 2023 7:22 am
by GlennSmith
Hi,
Yes, I downloaded the sources and i compiled for Ubuntu without any problems. Thanks for the reminder about cc65.
Glenn

Re: SDCC for 6502

Posted: Wed Jun 07, 2023 8:18 am
by drogon
GlennSmith wrote:
Hi,
Yes, I downloaded the sources and i compiled for Ubuntu without any problems. Thanks for the reminder about cc65.
Glenn
Glad you're sorted.

I think it's good that there is a choice of C compilers now (and I used sdcc for a PIC project some years back too but never really thought of it for the 6502).

VBCC runs under Linux too:

http://www.compilers.de/vbcc.html

but I've not tried to use it - mostly because cc65 fits all my needs.

-Gordon

Re: SDCC for 6502

Posted: Sun Jan 21, 2024 8:52 pm
by barnacle
I was just reminded of SDCC and had a quick look for updates: they're now up to 4.4 and include generation for both (either of) 6502 and 65C02.

I haven't played with it yet to find out whether the previous issues I noted - particularly with interrupt vectors - have been addressed, but it looks possible.

Neil

Re: SDCC for 6502

Posted: Mon Jan 22, 2024 12:47 am
by johnwbyrd
GlennSmith wrote:
Hi,
It would be nice to have a 65c02 cross-compiler that didn't have to be forced to run under wine on linux machines(*).
Linux is a first-class host for llvm-mos, and it supports 65c02 natively.

Re: SDCC for 6502

Posted: Mon Jan 22, 2024 8:08 am
by GlennSmith
Quote:
Linux is a first-class host for llvm-mos, and it supports 65c02 natively.
Wow! (or Gosh! or somesuch) : it looks a bit frightening at first... As I haven't yet created the customization files for my setup in cc65 , I'll try and do a comparison between the two environments. The big + for cc65 is that there are many of you out there using it regularly.
Thanks, in any case.

Re: SDCC for 6502

Posted: Mon Jan 22, 2024 8:34 am
by drogon
GlennSmith wrote:
Quote:
Linux is a first-class host for llvm-mos, and it supports 65c02 natively.
Wow! (or Gosh! or somesuch) : it looks a bit frightening at first... As I haven't yet created the customization files for my setup in cc65 , I'll try and do a comparison between the two environments. The big + for cc65 is that there are many of you out there using it regularly.
Thanks, in any case.
Which is a bit of a downer for the LLVM system and those who have made it happen, however unless you're already an LLVM / Clang user, then the "getting into it" may well feel somewhat daunting.

I'm sticking to cc65 for now.

-Gordon

Re: SDCC for 6502

Posted: Tue Jan 23, 2024 12:26 am
by johnwbyrd
drogon wrote:
GlennSmith wrote:
Quote:
Linux is a first-class host for llvm-mos, and it supports 65c02 natively.
Wow! (or Gosh! or somesuch) : it looks a bit frightening at first... As I haven't yet created the customization files for my setup in cc65 , I'll try and do a comparison between the two environments. The big + for cc65 is that there are many of you out there using it regularly.
Thanks, in any case.
Which is a bit of a downer for the LLVM system and those who have made it happen, however unless you're already an LLVM / Clang user, then the "getting into it" may well feel somewhat daunting.

I'm sticking to cc65 for now.

-Gordon
Yep, gravity is a thing. cc65 definitely has a much larger installed base. Most of the people using llvm-mos right now are either cycle counters, or people who need strict C compliance. Anyway, as the home page points out, the compiler is on Godbolt, so you can play with it without installing anything. https://godbolt.org/z/T5r1xPYG9

Re: SDCC for 6502

Posted: Tue Jan 23, 2024 8:33 am
by Yuri
johnwbyrd wrote:
Yep, gravity is a thing. cc65 definitely has a much larger installed base. Most of the people using llvm-mos right now are either cycle counters, or people who need strict C compliance. Anyway, as the home page points out, the compiler is on Godbolt, so you can play with it without installing anything. https://godbolt.org/z/T5r1xPYG9
Wait, there's an LLVM back end that will spit out 6502 assembly? o_O