The Boston Diaries

The ongoing saga of a programmer who doesn't live in Boston, nor does he even like Boston, but yet named his weblog/journal “The Boston Diaries.”

Go figure.

Friday, August 03, 2001

The following came through on a mailing list I'm on:

The Letters page of these magazines are as interesting as some of the articles. Of course, when we're talking about over 20 years ago in a hobbyist magazine, the letter-writers of one issue were quite likely to write articles in the next.

From David C. Broughton of Northwood, Middlesex, in the November 1978 issue:

Here is a little puzzle to test your readers' 8080 machine ingenuity:

“Imagine you possess an 8080 with 64K bytes of read/write memory which you want to clear. Write a program that sets all 65536 bytes to zero.”

It seemed like a fun little puzzle so I tried my hand at it.

The 8080 can address 65,536 bytes of memory, so the implication behind this is to clear all of memory, including the running program! Which means that the last instruction to execute has to clear out the last instruction! Since it's a byte addressed machine, that means that the last instruction has to pretty much be a single byte in size.

Not that big a deal. There are a few one byte instructions that write a byte to memory through an index register. Unfortunately, there are no “write-byte-increment-pointer” type instructions. So you need to increment (or decrement) the pointer. No big deal; there are one byte instructions to do that as well.

So, to write a byte and increment a pointer takes two bytes. So that's two cycles I have to go through, but depending on which direction I clear memory with (it doesn't really matter which way you go, as the address will wrap around anyway) I may wipe out the instruction with which I'm clearing out memory. At one point I had:

That didn't dawn on me until after an hour and a half of writing 8080 code (which I'm not terribly familiar with and all the references I have are for the Z80, which is a superset of the 8080.

Obligatory Picture

[The future's so bright, I gotta wear shades]

Obligatory Contact Info

Obligatory Feeds

Obligatory Links

Obligatory Miscellaneous

You have my permission to link freely to any entry here. Go ahead, I won't bite. I promise.

The dates are the permanent links to that day's entries (or entry, if there is only one entry). The titles are the permanent links to that entry only. The format for the links are simple: Start with the base link for this site: https://boston.conman.org/, then add the date you are interested in, say 2000/08/01, so that would make the final URL:

https://boston.conman.org/2000/08/01

You can also specify the entire month by leaving off the day portion. You can even select an arbitrary portion of time.

You may also note subtle shading of the links and that's intentional: the “closer” the link is (relative to the page) the “brighter” it appears. It's an experiment in using color shading to denote the distance a link is from here. If you don't notice it, don't worry; it's not all that important.

It is assumed that every brand name, slogan, corporate name, symbol, design element, et cetera mentioned in these pages is a protected and/or trademarked entity, the sole property of its owner(s), and acknowledgement of this status is implied.

Copyright © 1999-2024 by Sean Conner. All Rights Reserved.