News for hackers. Stuff that matters.
Re:Multiplying and Dividing on the 6502 (2021) by cbm-vic-20 on Tuesday June 28, 2022 @04:51PM (#31912853)
The successor to the 6502, the 65816 (both of which are still currently available as new parts from WDC) is a lot more compiler-friendly than the 6502, but is still pretty weird by "real" RISC standards.
Re:Multiplying and Dividing on the 6502 (2021) by pcwalton on Tuesday June 28, 2022 @05:06PM (#31913007)
The 65816 has stack-relative addressing, and a relocatable direct page which can act as a sort of frame pointer, but it's still a far cry from being compiler-friendly. Severe annoyances include the painful lack of registers, having 8 and 16 bit be a global mode switch instead of just specifying the size in the instruction, lack of a barrel shifter, and the near/far pointer distinction. There's a reason why there have never been successful ports of GCC or LLVM to that architecture, even out of tree.
Re:Multiplying and Dividing on the 6502 (2021) by adamius on Tuesday June 28, 2022 @05:15PM (#31913112)
That's a little less true about LLVM. https://llvm-mos.org/wiki/Welcome They seem fairly sure that llvm can be convinced to support a 6502 target.

As for gcc, I'm fairly sure gcc has at least one out-of-tree but yeah perhaps the code wasn't as good as hand rolled.

Re:Multiplying and Dividing on the 6502 (2021) by dietrichepp on Tuesday June 28, 2022 @05:26PM (#31913224)
I know that some retail games for the SNES were written in C, so there are one or two C compilers out there. I'm curious what the history is for 65C816 compilers (besides the one you can get from WDC).
Re:Multiplying and Dividing on the 6502 (2021) by ksherlock on Tuesday June 28, 2022 @06:54PM (#31914155)
The WDC C compiler was originally known as Zardoz C. ORCA/C (For the Apple IIgs) was eventually ported to run on MPW (Macintosh Programmer's Workshop) and used for some SNES development as well. Apple had a C compiler (APW C) for the Apple IIgs and cross development on MPW. 2500 AD Software bought up by Avocet Systems in 1997) had a 65816 C cross compiler as well.
Re:Multiplying and Dividing on the 6502 (2021) by djmips on Wednesday June 29, 2022 @12:04AM (#31916371)
Ancient Land of YS was programmed by me mostly using APW C with assembly used for graphics routines. Thanks for the info on Zardoz. I always wondered what became of it - it was my favorite.
Re:Multiplying and Dividing on the 6502 (2021) by djmips on Wednesday June 29, 2022 @12:02AM (#31916359)
I used Zardoz C to make the original FIFA soccer on the Super Nintendo. Of course there was a lot of hand rolled assembly but a lot of the UI and some parts of the game were written using Zardoz. The ability to use the DP as the base for local variables meant the code generation wasn't too terrible.
Re:Multiplying and Dividing on the 6502 (2021) by kbelder on Tuesday June 28, 2022 @05:38PM (#31913346)
I learned C on a C compiler for the c64.

https://archive.org/details/Super-C_1986_Abacus