A program of zero bytes, worth £5

(written by lawrence krubner, however indented passages are often quotes). You can contact lawrence at: lawrence@krubner.com, or follow me on Twitter.

Interesting:

User feedback [on both Tatung’s TPC-2000 and Einstein lines] repeatedly mentioned an irritation: that users often found they had to exit their current application [VisiCalc, WordStar, …] to perform simple disk operations, like finding a file on a floppy. It was a real and frustrating problem. For example, say they were running the popular WordStar word-processor and wanted to find an existing file for editing. Let’s also say they’re not sure which of a dozen floppy disks the file is on – they needed to use CP/M’s DIR command to locate it. But, in order to use DIR they’d first have to exit WordStar. Of course, once they’d found their document they’d have to re-run WordStar, i.e., they had to load WordStar off a floppy again – a real pain, esp. as we’re talking very slow floppy speeds here [for those that remember the sound – chunk chunk chunk is fairly onomatopoeic I think]!

To solve this problem I came up with the idea of GO.COM. The most profitable program ever written?

When a CP/M program loaded into memory, it was always located at the same address, at 0100h – the start of the so called ‘Transient Program Area’ [TPA]. CP/M’s own mini-programs like DIR loaded, or were defined as resident subroutines elsewhere.

Well, it occurred to me that, as WordStar was still in memory [although the user had exited the program, the memory containing it (the TPA) was still intact] it would be rather useful to somehow re-execute the program in the TPA directly; rather than reloading it, i.e., why reload it from disk when it was already in memory? However, to do that you’d have to execute whatever code lay at the 0100h address once you’d finished using DIR etc. But, how to make that happen – you couldn’t write a conventional program to do it, as it would have its ‘jump to 0100h’ commands/code loaded into the TPA itself – at 0100h – thus, if run, it would just run itself!

That’s where GO.COM came in.

GO.COM contained no program bytes at all – it was entirely empty. However, because GO.COM was empty, but still a valid program file as far as CP/M was concerned (it had a directory entry and file-name ending with .com), the CP/M loader, the part of the OS whose job it is to pull programs off disk and slap them into the TPA, would still load it!

So, how does this help? Well, using the scenario above:

the user exited WordStar
the user ran DIR (or whatever else they needed) and at some future point would be ready to re-run Wordstar
the user now ‘loaded’ and ran GO.COM
the loader would load zero bytes of the GO.COM program off disk into the TPA – starting at address 0100h – and then jump to 0100h – to run the program it just loaded [GO.COM]!
result – it simply re-ran whatever was in the TPA when the user last exited to DOS – instantly [WordStar in this example]!
So, GO.COM, which consisted of zero bytes of code – and sold for £5 a copy is, I figure, the most profitable program ever written (as any other program will return mathematically fewer £s per byte than GO.COM did)!

Post external references

  1. 1
    http://peetm.com/blog/?p=55
Source