News for hackers. Stuff that matters.
Re:BASIC Computer Games by royjacobs on Tuesday April 09, 2019 @07:06AM (#19613425)
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/

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?)

Re:BASIC Computer Games by duxup on Tuesday April 09, 2019 @07:54AM (#19613677)
Horribly nested BASIC is just what you did before you did it better.
Re:BASIC Computer Games by jerf on Tuesday April 09, 2019 @10:36AM (#19615086)
On 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.)

Re:BASIC Computer Games by 0815test on Tuesday April 09, 2019 @12:45PM (#19616544)
The 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.
Re:BASIC Computer Games by bopbop on Wednesday April 10, 2019 @05:53AM (#19623188)
To 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.

Re:BASIC Computer Games by jim_lawless on Wednesday April 10, 2019 @08:19AM (#19623865)
You're thinking of zero page ($0000-$00ff), not the stack $0100-$01FF).
Re:BASIC Computer Games by bopbop on Wednesday April 10, 2019 @08:25AM (#19623902)
Yes I am! Thanks!
Re:BASIC Computer Games by drallison on Wednesday April 10, 2019 @04:55PM (#19628700)
The 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.
Re:BASIC Computer Games by ijelenic on Tuesday April 09, 2019 @04:01PM (#19618382)
It was “GOSUB” if I remember correctly!! Ah good old times!!
Re:BASIC Computer Games by jackhack on Tuesday April 09, 2019 @12:37PM (#19616458)
But it felt so liberating and high-level, compared to the assembly we wrote before. :)
Re:BASIC Computer Games by eropple on Tuesday April 09, 2019 @09:54AM (#19614609)
They 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.
Re:BASIC Computer Games by abecedarius on Tuesday April 09, 2019 @04:56PM (#19618850)
Actual title More BASIC Computer Games.