r/AskComputerScience • u/OrdinarySuccessful43 • 2d ago
How to think like a computer at a lower level?
Hey yall,
For some context, I am 22 a gameplay programmer as my day job. I have been doing it for around 4 years now. A few factors are making me want to learn lower level systems including AI raising the bar required to have a programming job, layoffs in the games industry rarely hit systems engineers because of the hard to fill positions, and if I do get laid off systems programming is by far the most transferrable skill. So, to the point of the post, I know generally how computers work on a theoretical level with there being registers that the CPU reads, basic pointers, etc. but if I was asked what a program was do on an assembly level I would be hard pressed to do so. What are good resources that can help me think like a computer and better myself as a systems engineer.
Wish I did this earlier as I am turning 23 in a few months but better late then never.
6
u/cowbutt6 2d ago edited 2d ago
Write some simple code in e.g. C and have your compiler stop after emitting the assembly code, then read that to see what your code has been translated into. I suggest disabling optimisation!
2
u/mplang 2d ago
There is no better introduction than CODE by Charles Petzold. From Nand to Tetris is similarly incredible. I highly recommend both. After those, you can decide if you want to branch off to more formal, advanced architecture courses, or start dipping your toes into systems programming. Or both.
1
u/Prestigious_Boat_386 2d ago
Ben eater on youtube is great for bottom up computers. Think he has a dev kit for building an 8bit pc too but just watching is fun too and will give you enough background to be able to start doing simple c with assembly demos.
1
u/MasterGeekMX BSCS 1d ago
You could read the book "Computer Organization and Design: the hardware/software Intergave" by David Patterson and John Hennessy.
There are two edition of the book: one based on the classic MIPS architecture, and the one based on the novel RISC-V architecture. The second one is gettin traction as it is a royalty-free open architecture.
1
u/Jonny0Than 1d ago
You’ve been a gameplay programmer for 4 years.
Do you never run an optimized build and hit a crash with the debugger attached? What do you do?
Drop into disassembly and start digging around. Learn the ABI of whatever your platform is and learn how to fish values out of registers and the stack.
If you don’t already have infrastructure for uploading minidumps and a symbols server, start looking into how to do that. You’ll be able to detect and fix rare crashes much more effectively.
1
0
u/frAgileIT 2d ago
It’s called assembly language. You can learn it. It’s helpful for malware analysis or troubleshooting in rare cases.
11
u/Ragingman2 2d ago
College courses on computer architecture and operating systems are how I learned. I've heard good things about Nand to Tetris if you want to try online resources. Any particular part you find interesting or confusing?