TitanUranus said:
Thank you SomeGuy99, a very kind and heartening response. I used to do the old c64 BASIC bouncing balls and stuff. I always remember getting those magazine listings to poke games and get infinite lives etc... I always wondered how on earth they came up with all those data lines and how they actually figured out where to poke the memory in the first place. If only I'd had VICE emulator with all the software and my I7 Quad Core PC back in 1985, how much more fun could a human ask for?
A few years ago a guy I knew was throwing out some C64 books, which I said i'd happily give a new home.
One of these books is the complete assembly code listing for the C64 rom. What's the ROM? Well maybe you don't know, but it stands for read-only-memory, and was used to store the the operating system of the machine. It's a lot like the NAND memory on the Pandora, but obviously you can't change it at all. The main reason for this was because flashable (writable) chips were way too expensive at the time (this was over twenty years ago). ROM chips can cost pennies I think, even then. But yeah, this had an advantage in that the operating system was essentially identical on every machine (although some machines from that era had a changeable ROM chip, like the Amiga and BBC).
So, this book was effectively the source code for the C64 OS. The OS being the interface between the application and the hardware on the machine. It was also documented in great detail! So an interested programmer could sit and read it on the toilet and find out what it all does.
These days, the equivalent would be documentation from Microsoft about how the Windows API works. An API is an application programming interface, and acts as a layer between the OS (which runs in memory) and the hardware. It was needed because the PC is such a non-fixed platform, with all sorts of hardware combinations (just think of the Dos days, where every game had to write multiple sound card drivers just to work across the board). Also, your OS now exists on writable memory (your hard disk) and is subject to change. Programming with the API is consistent, just like programming with the C64 ROM was consistent.
What you were doing with peeks and pokes was rewriting parts of the program stored in memory. For example, you can give yourself an extra life by changing a machine code instruction that subtracts one from the lives variable to something else (eg. do nothing). All cheat cartridges and cheat code systems use the same thing, even now.
If you're interested, you can view the assembly output for Windows quite easily. Microsoft even provides the tools for this (or at least they used to back in the Windows 98 era, it was a dos command). The process is called dissassembly, but it won't be all that useful - the output is just far too much to humanly read or work with (because executables are now millions of lines long).