CppCon 2016: Jason Turner “Rich Code for Tiny Computers: A Simple Commodore 64 Game in C++17”
—
Presentation Slides, PDFs, Source Code and other presenter materials are available at:
—
The Commodore 64 was released in 1982 and is the best selling computer model of all time. At 34 years old, even the most simple embedded processor today outperforms it. Join me on an exploration of how C++17 techniques can be utilized to write expressive, high performance, high level code for simple computers. Together we will create a game for this aging system.
You’ll leave the talk with a better understanding of what your compiler is capable of and be able to apply these ideas to create better code on modern systems.
—
Host of C++Weekly Co-host of CppCast Co-creator and maintainer of the embedded scripting language for C++, ChaiScript and author and curator of the forkable coding standards document I’m available for contracting and onsite training.
—
Videos Filmed & Edited by Bash Films:
Source: https://cyrrion.com
Read more all post Computer Technology : https://cyrrion.com/computer/
6502 is a brain of f14 tomcat jet fighter
This is brilliant !
Wow, amazing!
28:06 was amazing 🙂
I love this talk
bookmark: 25:28
To me this is THE best C++ presentation in the post C++11 era. Have watched it twice. Entertaining, interesting (inspired use of retro-computing as a hook), and informative/educational in respect to C++ the language
I just started to learn C++ and the video was amazing. Thanks.
the actual correct use of volatile !!
Awesome
Hi JT,
please, just take a look on what David Holz did with his AcheronVM: https://www.youtube.com/watch?v=zdJnz6-d060
For the note: it is a different (socially flood) person than: @DavidSHolz, he is aka "White Flame": http://forum.6502.org/viewtopic.php?f=1&t=2236
IMHO: this could be the next step of your "x86->6502 reassembler", it could be truly LLVM semantics capable mid-ware
Stupid? No, why would it be stupid. Doing something you enjoy, fancy, and take fun and pleasure in isn't stupid. Creation is never stupid.
As for PowerPoint crashing: I must be the only person in the whole world who RARELY experience issues with Windows and Office…What are you all doing to your computer, ladies and gents!?
28:00 it's truly 👀 opening
6502 compatible CPUs were the ARM CPUs of the late 70s/early 80s
I know this video is 3 years old, but I keep referring people to this video because it's doing such a great job at dispelling some misconceptions. Unfortunately, there are no closed captions available for this video, which prevents me from showing this video to a deaf co-worker.
I know generating proper captions would be a mammoth undertaking, but I would appreciate it if the automatic captions for this video would be enabled. Thank you in advance.
15:00 wait – a function in an anon namespace is visible in `main`?
Excellent presentation, It was like seeing magic how compiler can optimize code .
this is amazing, is there a similar compiler explorer for java?
Who else came to watch after hearing Bjarne reference this talk on Lex Fridman's AI podcast?
Well done, this was eye Opening.
A shame you dont show the C64 emulator running the code as well while you do the coding/testing.
Very cool! As an alternative to the online C++17/IDE by Matt Godbolt.org that was mentioned, there's a few others that may be help.. webminal, codechef, jdoodle, rextester, linuxcontainers, thinapps.org , tutorialspoint, ideone, remoteinterview.io , onlinegdb, repl.it, codepad.org, cpp.sh, leafo.net, PythonAnywhere
27:15 im going to show this to anyone who complains that I overuse const
Extremely good presentation, near perfection
How did you manage to translate the x86 asm code to 6502
Great work Jason
Did they say the x86 has hardware sprites?
Seriously?
x86_64 have 16 registers and it would be impossible to use all of them on PC (it doesn't matter if it is Windows or Linux or something else, as it is physical architecture which eats up resources, not logical one
i386 had 8, of which 6 were (sort of) general purpose
this is NEITHER PowerPC (32) NOR SPARC (32 with banks or renaming (I am confused now, as I do not remember) plus each thread have full set of registers)
4:13 "No modern compilers officially support [the 6502 instruction set]"… um, no. Sorry, but I had to stop watching at this point.
I want to be a master of C++.
How long does it take?
cc65. A modern C compiler for 8 bit machines including the 64
amazing…!
As a Commodore 64 and C++ programmer, I have only these questions:
1. Show me the C++ source file.
2. Show me the 6510 executable.
19:07 assigning 'a' directly will not work. C64 uses PETSCII instead of ASCII, so a conversion table wil be needed. Also the video memory is a bit tricky, because it doesn't use PETSCII directly. 'a' is 0x61 in ASCII, but it would output only some bar on the screen. You'll need to write 1 to memory address 1024 to get an "A". See http://sta.c64.org/cbm64scr.html for details.
Exceptions in C++ seems a game breaker regarding the zero-overhead thing. You have to be very careful not to use any thing that might throw.
It’s ridiculous . What’s the point of this video ? It’s slow as hell, how can you talk about efficiency ? All that for a pong …
And in a few weeks; Bethesda will have a Skyrim Port for the Commodore 64…
386 has 8 general-purpose integer registers. Using the 8-bit partial registers instead of the full register for EAX-EDX, i.e. AL/AH, BL/BH, CL/CH, and DL/DH, you get a total of 12 GP registers. This still includes the stack pointer, which you shouldn't really count unless you're actually stashing it somewhere to use it for a variable value in a hot loop. (Normal compilers will never do this for you.)
386 has segment registers, control registers, and other stuff, but you can't use those for arbitrary variables. And even if you could, you don't want to because they're slow to read/write and you can't use them as operands for ALU instructions. (Especially slow on modern x86 where you have fast L1d cache that makes local variables in memory not a disaster if store/reload isn't part of the critical path latency.)
modern x86-64 still only has 16 integer registers, 16 xmm/ymm vector registers, and 8 MMX registers (or 8 x87 stack regs instead of MMX). Register renaming onto a large pool of physical registers doesn't help you avoid spill/reload if you need more values live than you have architectural registers to store them in. Moving data between different kinds of registers varies in efficiency, but always takes an instruction.
This talk came up an a Stack Overflow question; I wrote an answer (https://stackoverflow.com/questions/49807965/how-to-know-an-assembly-code-is-using-ram/49809894#49809894) where the 2nd part addresses the point about registers in a bit more detail.
Anyone has a good video that explains what is the overhead he is talking about 😛
This is why i love C++.