Live data from Hacker News

C++14 for the Commodore 64 [video]

youtube.com

1–10 of 28 posts

Re: C++14 for the Commodore 64 [video]

#4

Why is he doing this with an x86 compiler. The c64 used a 6510. None of this code would ever work. ...Oh, if you jump to about halfway through he starts using an x86->65xx translator. Okay. Nice.

There already seems to be a 6502 backend for LLVM specifically geared for c64:

https://github.com/c64scene-ar/llvm-6502

Which means you can just use the clang frontend and even write C++17 code which compiles down to 6502 ML.

Re: C++14 for the Commodore 64 [video]

#5

Why is he doing this with an x86 compiler. The c64 used a 6510. None of this code would ever work. ...Oh, if you jump to about halfway through he starts using an x86->65xx translator. Okay. Nice.

There already seems to be a 6502 backend for LLVM specifically geared for c64: https://github.com/c64scene-ar/llvm-6502 Which means you can just use the clang frontend and even write C++17 code which compiles down to 6502 ML.

I was unable to get any of the existing 3 llvm 6502 backends to produce reasonable code. Which is why I went this route. I meant to mention that in the video...

Re: C++14 for the Commodore 64 [video]

#8
post #7

Nothing gives the warm fuzzies like seeing the translator step couldn't parse anything except the code he specifically wrote for the demo...

Functional calls are not handled, which is part of the problem. There are several working examples in the x86-to-6502 repository. Please add more examples and help with additional translation.

Re: C++14 for the Commodore 64 [video]

#10
Oh man, I remember trying to understand AppleDOS and 6502 Assembly on the Apple II+ when I was a wee lad. It was so confusing what all these hex memory locations were. Being able to give them actual function names (or even just named constants!) would have made things so much easier!
Post reply on HN