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

From: Sean 'Captain Napalm' Conner <spc_at_conman.org>
Date: Sat Aug 4 04:01:14 2001

It was thus said that the Great "Fred Cisin (XenoSoft)" once stated:
>
> On 4 Aug 2001, Iggy Drougge wrote:
> > > 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."
> > Seemed like a piece of cake until it dawned upon me that the program has got
> > to be stored somewhere. =/
>
> PUSH is a good way to do it, BUT, ...
> To clear ALL memory, the PUSH instruction must be at location 0 (at least
> by the end of the program). Otherwise, the program code will be zero'd
> out before it is done.

  It doesn't have to be at 0, but it does have to be the last executable
instruction other than NOP (which is $00).

> Can you do it WITHOUT self-modifying code?

  Yes. 8-)

  -spc (It only took me two hours because I've never programed the 8080/Z80
        before ... )
Received on Sat Aug 04 2001 - 04:01:14 BST

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