Checking the registers

In response to his almost incomprehensible rambling during Oh that would be VERY difficult! – Part 5, the author was recently pointed towards Compute’s Mapping The Commodore 64, a book which exhaustively delves into the C64’s memory and how it’s used. He of course didn’t understand what the book was telling him presumably because he didn’t actually read it and just skimmed through before making some uneducated guesses that would fit with his current world view, so let’s take a quick look at his response to said comment.

This book is 292 pages long according to the link you sent. The list of memory locations starts at 0. The point I’m making is how many memory locations are people supposed to remember to write programs on the C64?

This is an almost ridiculously vague question since it doesn’t specify which kind of programs; anybody writing a text adventure in BASIC has to know a grand total of zero memory locations, someone creating a single screen, sprite-based action game in assembly language needs access to some registers and those can be represented as offsets from a handful of base addresses meaning that knowledge of at most half a dozen numbers is required and not all of them are five digits either.

Even if someone were to insist on referring to the video registers directly there are only forty seven in total; the simple action game mentioned above hasn’t got to set sprite expansion or priority registers for example and certainly doesn’t need to be checking the current position of a light gun either so there’s no need to know what all of the registers do.

It seemed to me while I owned that computer that the number of locations I might have to remember may be 65,536 (i.e. 64K) or perhaps 65,536-38,911 (i.e. the number of “BASIC BYTES FREE” on the C64 startup screen, which makes 26,625. I know it’s far more than the number of registers in the VIC-II and SID chips. There may be a clue of pages 83-84 of that book, where the memory locations listed suddenly jump from 8191/$1FFF to 32768/$8000.

The author is confusing memory-mapped video, sound and I/O registers with memory as a whole dear reader; the spaces outside the 38,911 bytes allocated to BASIC programs don’t, as he falsely believed, all serve specific purposes that need to be learnt and the vast majority are merely memory that a programmer can assign at will. Yes there are rules and caveats to be learnt about specific ranges of memory – it’s not possible to store graphics data at $1000 to $1fff or $9000 to $9fff for example because the VIC-II sees a shadow of the ROM character set in those areas – but other 8-bits have similar rules and caveats so it’s not something unique to the C64.

Of course, Commodore manuals never said what the limit was to the number of memory locations. What is the actual number of memory locations budding programmers would have do deal with?!

The C64’s manual doesn’t exhaustively cover the memory map (the C64 Programmer’s Reference Guide does however, something that shouldn’t come as a surprise to anybody considering the title) but also doesn’t imply that a large swathe of memory locations need to be learnt either; that’s a mistake on the author’s part that a little further reading would have corrected.

Advertisements
This entry was posted in Commentary, Debunking and tagged , , , . Bookmark the permalink.