5 ms·
The interesting podcast "They Create Worlds" recently had an episode on this topic, it's worth a listen: https://tcwpodcast.podbean.com/e/computer-game-basics/
by royjacobs 8y ago
The interesting podcast "They Create Worlds" recently had an episode on this topic, it's worth a listen: https://tcwpodcast.podbean.com/e/computer-game-basics/ https://tcwpodcast.podbean.com/e/computer-game-basics/
Growing up I had a Commodore 64 and for some reason came into possession of another of David Ahl's books ("More Computer Games" I think it was called). It contained Eliza as one of the listings and it was a program that fascinated me so much I ended up creating a ton of clones, in horribly nested BASIC (though, to be fair, is there any other kind?)
- duxup 8y agoHorribly nested BASIC is just what you did before you did it better.
- jerf 8y agoOn the Commodore 64, it was the only option. It had minimal support for a thing it called a "subroutine", but what it really was was a GOTO that pushed the source on to the stack and could be RETURN'd to that source. In particular, no concept of return value, no concept of parameters; everything's global. Modification of global values prior to the "call" is the argument passing, and modification of global values is the "return". Commodore 64 BASIC, and 8-bit BASIC in general, was fully in the paradigm that Dijkstra was referring to when he wrote Goto Considered Harmful. (Not exclusively, of course.)
- 0815test 8y agoThe 6502 processor itself also has very poor "stack" support, the hardware-supported stack is limited to 256 bytes at a fixed location. It's one of the things that make it hard to compile a modern language like C for the architecture, so even among compiled languages one would prefer something FORTRAN/BASIC-like.
- bopbop 8y agoTo be fair, the 256 byte stack can essentially be used in assembly as 256 registers, which is also one of the features (along with indirect addressing) that make assembly on it awesome. My relatively poorly researched impression of it is that it's half-way to portable C, with a proto-stack and pointers, essentially.
- jim_lawless 8y agoYou're thinking of zero page ($0000-$00ff), not the stack $0100-$01FF).
- bopbop 8y agoYes I am! Thanks!
- drallison 8y agoThe on-chip stack on the 6502 was not intended to be used for implementing the stack for programming language procedure calls; it was intended to provide system extension functions that provide things missing in the 6502 instruction set,(for example, multiply), which had to be implemented with multiple instructions. For "modern" languages like C, 16-bit 2's complement integer arithmetic was expected but the 6502 native instructions were for 8-bit numbers.
- ijelenic 8y agoIt was “GOSUB” if I remember correctly!! Ah good old times!!
- jackhack 8y agoBut it felt so liberating and high-level, compared to the assembly we wrote before. :)
- eropple 8y agoThey Create Worlds is a fantastic podcast in general, and I encourage folks with an interest in the history of games--or of computer tech in general, given the way it's historically tracked--to give it a listen. Alex is one of the true scholars of the topic.
- abecedarius 8y agoActual title More BASIC Computer Games.