# How to get “under the hood” of an old C64 game?

**URL:** <https://boards.straightdope.com/t/how-to-get-under-the-hood-of-an-old-c64-game/838257>\
**Category:** Factual Questions\
**Created:** [August 6, 2019, 5:32pm UTC](https://boards.straightdope.com/t/how-to-get-under-the-hood-of-an-old-c64-game/838257 "2019-08-06T17:32:11Z")\
**Posts on this page:** 5\
**Page:** 3

<div class="post-metadata">

**Author:** ![tavaritz](https://avatars.discourse-cdn.com/v4/letter/t/71e660/32.png) [@tavaritz](https://boards.straightdope.com/u/tavaritz)\
**Post date:** [August 11, 2019, 6:24am UTC](https://boards.straightdope.com/t/how-to-get-under-the-hood-of-an-old-c64-game/838257/41 "2019-08-11T06:24:19Z")

</div>

> [@Kobal2](#):
>
> Within the ridiculously tight confines of available memory of that era, there was also a thin line between “ingenious hack” and “deep Magic”. Which sadly doesn’t really seem to exist in our world any more.

That’s not quite true but the environment where that is still done is robotics ea. selfcontained programmed workunits. They have small memory controllers that you want to squeeze everything out.

---

<div class="post-metadata">

**Author:** ![tavaritz](https://avatars.discourse-cdn.com/v4/letter/t/71e660/32.png) [@tavaritz](https://boards.straightdope.com/u/tavaritz)\
**Post date:** [August 11, 2019, 7:15am UTC](https://boards.straightdope.com/t/how-to-get-under-the-hood-of-an-old-c64-game/838257/42 "2019-08-11T07:15:21Z")

</div>

I had C64 way back when and there was a dedicated magazine published in England (I’m a finn) that I subscribed. It had program listings that one could key in and execute and get somthing nifty. Most were simple games and one was an adventure game. I was baffled why would anyone publish an adventure game to key in when in keying in you read all the text in the game and know exactly what you need to do. Btw. these were all in C64 Basic.

So I wrote an adveture game that only had this big array and and an interpretter. All the code and data of the game was in that huge array of numbers and the interpretter was very stripped down Forth-interpretter that executed that array. They published it and in the next number I got lists of asks to publish how to write the games for my interpretter and I complied and others start to publish their games using the same interpretter. Fun times.

---

<div class="post-metadata">

**Author:** ![Kevbo](https://avatars.discourse-cdn.com/v4/letter/k/e47774/32.png) [@Kevbo](https://boards.straightdope.com/u/Kevbo)\
**Post date:** [August 12, 2019, 3:38pm UTC](https://boards.straightdope.com/t/how-to-get-under-the-hood-of-an-old-c64-game/838257/43 "2019-08-12T15:38:28Z")

</div>

> [@engineer\_comp\_geek](#):
>
> While Booth’s algorithm requires a lot of looping, it has the advantages of being both compact and easy to understand.

In case anyone gets the bright idea of unrolling those loops:

Since the early processors were not pipelined, nor cached, unrolling those loops doesn’t help much. (saves a little time, but memory was sparse back then, so was seldom done.)

---

<div class="post-metadata">

**Author:** ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)\
**Post date:** [August 12, 2019, 5:23pm UTC](https://boards.straightdope.com/t/how-to-get-under-the-hood-of-an-old-c64-game/838257/44 "2019-08-12T17:23:29Z")

</div>

Isn’t Booth’s algorithm basically just the binary equivalent of the method grade schoolers are taught for multiplying with pencil and paper?

---

<div class="post-metadata">

**Author:** ![ftg](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/ftg/32/2801_2.png) [@ftg](https://boards.straightdope.com/u/ftg)\
**Post date:** [August 12, 2019, 5:44pm UTC](https://boards.straightdope.com/t/how-to-get-under-the-hood-of-an-old-c64-game/838257/45 "2019-08-12T17:44:47Z")

</div>

> [@Chronos](#):
>
> Isn’t Booth’s algorithm basically just the binary equivalent of the method grade schoolers are taught for multiplying with pencil and paper?

It’s a bit more [complicated](https://en.wikipedia.org/wiki/Booth's_multiplication_algorithm). It looks at two bits at a time and does one of four things during a step. But then it shifts only 1 bit for the next step.

It relies on properties of 2’s complement numbers.

Me, I prefer the Wallace tree multiplier. Much faster. You just need a lot of gates, but still sub quadratic.

[Previous page](https://boards.straightdope.com/t/how-to-get-under-the-hood-of-an-old-c64-game/838257.md?page=2)
