Personal Computer World magazine: an 8080 puzzle and "Z80 is dead"

From: Sean 'Captain Napalm' Conner <spc_at_conman.org>
Date: Fri Aug 3 17:59:28 2001

It was thus said that the Great Paul Williams once stated:
>
> 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.
>
> Two extracts for you.
>
> >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."

                ORG 0
ENTRY0 DI ; disable interrupts
                LD BC,$0000 ; value to fill mem with
                LD SP,$0008 ; start here
                NOP ; filler
ENTRY1 PUSH BC ; save data
                RST 1 ; loop forever

  I probably mixed both 8080 and Z80 instructions here, but the references I
have are rather spotty and mostly for the Z80 (but I think I only used
common instructions---it's not a chip I've programmed much for).

  It only took me two hours to figure this out because you have to go
through memory AND wipe it all out (which means you wipe out the program as
you go) and I kept getting stuck on the fact that I couldn't quite clear all
of memory (once the code to increment or decrement the pointer was wiped
out, then you're stuck writing to the same location over and over and the
8080/Z80 don't really have a 16-bit move instruction) but once I started
looking at PUSH/POP it suddenly hit me.

  -spc (It was actually quite fun 8-)
Received on Fri Aug 03 2001 - 17:59:28 BST

This archive was generated by hypermail 2.3.0 : Fri Oct 10 2014 - 23:33:31 BST