C++ Weekly - Ep 19 C++14 For The Commodore 64

Channel:C++ Weekly With Jason Turner · Length:17:12 · Published:2016-07-11 · Views:25271

Watch on YouTube

Summary

An episode of C++ Weekly in which Jason Turner shows modern C++14 compiling to the Commodore 64's 6502. It demonstrates writing efficient high-level code for 8-bit hardware.

Why HN recommends it

Cited as an example of using modern C++ on 8-bit hardware.

C, C++, Rust, Go & systems languages · Demoscene & retrocomputing

Subtitles (excerpt)

Hello and welcome to C++ Weekly. I'm your host, Jason Turner. Once a week, I pick some topic of interest in C++ and dig into it with some live coding. In this episode, I'm going to discuss building C++ 14 programs for the Commodore 64. And the very first question that you should probably ask is why in the world would we want to do such a thing? And the reason is because modern C++ can be compiled to extraordinarily efficient object code. And this is something that I'll demonstrate using the excellent compiler explorer from Matt Godbolt. So the website starts you out with a simple code editor on the left and an assembly output on the right. We are using GCC 6.1 in this example and we have all optimizations and warnings turned on and the compiler set to C++ 14 mode. So in the Commodore 64, it is possible to change the border color of the screen by writing to the memory location D 020. And we can do this in our main. So what we have here is we have the memory location D 020 which we are using a reinterpret cast to convert that to a Uint 8 that's an unsigned 8 bit integer pointer and we are dreferencing that pointer and we are assigning it the value 1 and as you can see over here this very simply moves the

On Hacker News

I'd recommend watching this CppCon talk [1] about compiler optioning. It isn't just that recompilation is hard, or that it is difficult for humans to do. At a fundamental level, the information is not there at all, because the compiler can make very impressive optimizations. Machine learning can deal with weak signals, but it can't deal with no signal. [1] [VIDEO] — MereInterest, 2019-07
It is a return to the age when we had BASIC and Z80/6502 Assembly, and yes doing memcpy/strcpy all over the place instead of having proper arrays and strings is that bad. At very least, C++. "C++14 For The Commodore 64" [VIDEO] — pjmlp, 2025-03
Your second link reminded me of [VIDEO] (which definitely builds on some of Matt's work). [LINK] - C++17 for the Commodore 64. Probable language warnings for my other suggestions: * Rescuing Prince of Persia from the Sands of Time [LINK] (was this talk ever given elsewhere?) * And You Shall Know Me By My Trail of Documentation - [LINK] * The History and Evolution of Computer Viruses - [LINK] — voltagex_, 2016-10

Related videos