The Infinitely Profitable Program

Ξ March 11th, 2008 | → 31 Comments | ∇ Coding, Geeky, Software, Technical |

A recent article on Slashdot about assembler games-programming on an Atari [Donkey Kong and Me] got me reminiscing about writing assembler apps in my own early days – and about the machines we had way back when.

Having earlier cut my teeth on a DEC PDP-8, the biggest kick I got was when CP/M came out. CP/M was initially a ‘business operating system’ – but – it was also a system that one could possibly afford to have at home, on a Personal Computer – serious stuff for an up-and-coming nerd!

I was working for Tatung at the time, and as they built computers, I got to play with some pretty expensive kit – twin five and a quarter inch floppy drives and everything! I mostly worked on debugging the ERSO BIOS, and also worked on the Tatung Einstein computer; which used a compatible but beefed-up and expanded version of CP/M called Xtal DOS.


The Einstein was a great little machine for a while [before MS-DOS machines really came into their own], as well as being able to run CP/M programs like VisiCalc and WordStar, it could also run great games programs as it had in-built sound and graphics capabilities [colour and sprites!]. And all for £499 [that’s in 1984 remember] – pretty pricey for the day!


Peet’s Utilities:

I wrote articles for Tatung’s Einstein magazine, which I still have kicking around somewhere, and some commercial programs too. The most successful group of these was a suite of programs called, creatively enough, ‘Peet’s Utilities’ [1986].

Written in Z80 Assembler [I didn’t know about languages like C then], the utilities included an undelete, hex-editor, function-key programmer (a TSR; if the reader knows what such a thing is!), program auto-boot (like ‘run on start-up’ today), printer-controller, typewriter-emulator [yup I used typewriter there] and a whole host of other things. I sometimes wonder, if I’d have ported these to MS-DOS, I might have become Peter Norton [I assume Norton's Utilities made heaps, whereas I didn’t]! I recently found the contract I signed for Peet’s Utilities – I got the princely sum of £1 per copy.

For completeness, I should say how Peet’s Utilities was written – the mechanics of it; as it’s quite interesting, and indicative of the times.

It was written on a CP/M business machine – another Tatung machine as it happens [a TPC-2000 - the rightmost machine in this picture].

Young Peet!

The left most machines in the picture are Tatung Einsteins.

The TPC-2000 was faster and had more memory than the Einstein – and so could run my macro-assembler more efficiently. It was also a pure CP/M machine – so, by writing it on that I could be sure to not use some special Einstein-only feature or subroutine (as I could then market it more widely).

After I built the programs on the TPC-2000 I ported them to an Einstein using a program/protocol called Kermit – where I’d test/debug it proper! Quite a code/build/test/debug cycle for the times!

GO.COM:

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)!

Is it really infinitely profitable? Well, in terms of what I made out of it obviously NO – I’m not infinitely wealthy. However, GO.COM could truthfully be a ‘money for nothing’ case. For example, priced per byte, it would look this way

      Cost      £5
      ------- = --- =
      Bytes      0

I actually had some funny (as in not so) phone-calls and letters over GO.COM [no email back then]: Some purchasers - who were obviously into computers - rang up Tatung to speak to me and to ask how - and why - I'd disguised the size of the program (DIR reported that is was zero bytes remember). When I told them that it actually WAS zero bytes long, some of them became a little annoyed! “How dare you charge me £5 for nothing!” I told them that I hadn’t, I’d given them something useful and if nothing else, I charged them £5 for an implementation of the idea!

It’s a pity CP/M’s CCP didn’t have more in-built commands; the existing ones were limited to a small set of useful disk-based commands:

* ERA erases specified files.
* DIR lists filenames in the directory.
* REN renames the specified file.
* SAVE saves memory contents in a file.
* TYPE types the contents of a file on the logged disk.

I later ported GO.COM to early versions of MS-DOS, i.e., before the EXE file format existed - and it worked just as well there too! Happy days!

 

31 Responses to ' The Infinitely Profitable Program '

Subscribe to comments with RSS or TrackBack to ' The Infinitely Profitable Program '.

  1. Chris Morris said,

    on January 1st, 2010 at 1:54 am

    I had an Einstein, and it was my favourite computer back in the 80′s, I wrote a digital audio sampler in assembler using the A-D port (Joystick I think) on it. Its the only piece of kit I ever studied the circuit diagram of, and mostly understood.
    Ahh… those were the days, when computers weren’t such black boxes.

  2. yifan said,

    on July 14th, 2012 at 10:22 pm

    beautiful solution, love it.

  3. Leon said,

    on July 15th, 2012 at 4:45 am

    > I later ported GO.COM to early versions of MS-DOS,

    Love that one <3

  4. Stefan said,

    on July 16th, 2012 at 3:22 am

    Nice to see ham radio gear in your picture :-). Vy 73 de DL1ELY

  5. John said,

    on July 16th, 2012 at 5:43 am

    If you’d written version 2 I bet users would’ve paid £2.50 to upgrade :-)


  6. on July 18th, 2012 at 4:08 am

    [...] the late 1980s, Peet Morris wrote The Infinitely Profitable Program GO.COM. This empty executable simply caused CP/M to restart whatever program had previously been [...]


  7. on August 17th, 2012 at 7:52 am

    [...] most profitable program EVER Posted on August 17, 2012 by robertodealmeida via peetm.com Like this:LikeBe the first to like this. This entry was posted in Uncategorized. Bookmark the [...]


  8. on June 21st, 2013 at 9:24 pm

    [...] The Infinitely Profitable Program. [...]

  9. Kaushik said,

    on June 22nd, 2013 at 8:51 am

    Not only does your hack have the genius of simplicity (and is therefore elegant and beautiful) you writing is very clear and easy to understand. Thank you.

  10. Claudio Lisa said,

    on June 22nd, 2013 at 10:01 am

    Fantastic idea! … If I’m not asking too much … could you please share GO.COM source files?

  11. Ian said,

    on June 23rd, 2013 at 4:20 am

    how was that possible? Wasn’t there any garbage collector? It could be a security flaw.

  12. admin said,

    on June 23rd, 2013 at 5:46 am

    The source file was a zero length file, i.e., there really is no source code.

  13. admin said,

    on June 23rd, 2013 at 5:49 am

    Remember this is a long time ago – at a time when the single definition of ‘garbage collector’ was a human being.

  14. admin said,

    on June 23rd, 2013 at 5:49 am

    Thanks, de G4SFI

  15. Bob H said,

    on June 24th, 2013 at 11:44 pm

    Just for grins, I wonder if Go.com could have been patented. Imagine a patent on a zero-length executable! What a hoot!
    What is the algorithm you are patenting?
    Nothing, sir. Absolutely nothing.
    What’s the use of that?
    Oh, it’s very useful, I assure you. People will buy it and like it.
    But how can …. ?
    Look, it is an algorithm with zero steps. Zero is a number. So this is an algorithm. And it’s a non-obvious solution to a real problem. So it should qualify for a patent.


  16. on June 26th, 2013 at 6:43 pm

    [...] an incredibly useful early piece of software called "go.com" which was a zero-byte file, http://peetm.com/blog/?p=55 [...]


  17. on June 19th, 2014 at 2:56 pm

    Wait a minute – your telling me to not pay off what I owe – why is that.
    spending, which normally is the reason about 70 percent of U.

    You may not think it’s worth challenging small errors, but it’s actually a great method to fix low credit score, at least in part.

  18. Zac said,

    on June 28th, 2014 at 5:41 am

    What’s up, after reading this remarkable paragraph i
    am too glad to share my familiarity here with colleagues.


  19. on June 30th, 2014 at 7:24 pm

    Thanks to the advantages of Online marketing today it is possible to download your list of magic spells from
    home, and you simply don’t have to worry about spending too much time in your regional library pouring
    over thick and old courses. Love spells swallow up all love tribulations and inconveniences to furnish a mysterious result.
    Go over your simple spell at this stage and see if
    there’s anything you need to add.

    Feel free to visit my homepage; get your ex back


  20. on June 30th, 2014 at 7:47 pm

    Nice weblog here! Additionally your website so much up fast!
    What host are you the use of? Can I get your affiliate link on your host?
    I wish my site loaded up as quickly as yours lol


  21. on July 1st, 2014 at 2:52 am

    We are a group of volunteers and starting a
    new scheme in our community. Your site provided us with valuable
    info to work on. You have done an impressive job and our entire community will be grateful to you.


  22. on July 2nd, 2014 at 4:49 am

    For newest information you have to pay a visit web and
    on internet I found this website as a most excellent
    website for latest updates.

    my webpage: after effects wave Transition

  23. Cheats guide said,

    on July 2nd, 2014 at 12:15 pm

    Ahaa, its pleasant conversation concerning this piece of writing at this place
    at this weblog, I have read all that, so at this time me also commenting at this place.

    Here is my site Cheats guide


  24. on July 2nd, 2014 at 1:12 pm

    Thanks for sharing your thoughts. I truly appreciate your efforts and I am waiting for your further post thank you once again.


  25. on July 3rd, 2014 at 5:14 am

    Chevron has hauled them into court in New York,
    accusing them of fraud and extortion. It is always a good idea to check
    the major airlines’ airfares before booking with a low cost airline.
    Those were the best songs and had the best visuals in the entire movie.

    Feel free to visit my web site – modern war hack – modernwarhacks.wordpress.com,

  26. Ububa said,

    on July 4th, 2014 at 6:29 pm

    What’s Taking place i’m new to this, I stumbled upon this I’ve found It absolutely useful and it has aided me out loads.
    I hope to give a contribution & aid different customers like its
    aided me. Great job.

    Check out my web-siteat adult computer games (Ububa)


  27. on July 6th, 2014 at 2:19 am

    This new motions funny with Jonah Pile yet Channing Tatum lets us
    know related to few factory workers who really can start a greater courses to locate a pill ring.

    That’s why company’s spend millions of dollars on radio, t.
    A lots of battlefield report revealed continually, even cargo ships were all were wracked, which
    full with T2 ship.


  28. on July 8th, 2014 at 3:07 am

    Hello, this weekend is pleasant designed for me, since this time i am reading this fantastic informative piece of writing here at my
    home.


  29. on July 10th, 2014 at 7:07 pm

    The managers are well aware of the internet and its capabilities, but are reluctant to
    implement updated computers that provide a basis for effective marketing and communication. If not,
    find out what the plumber would charge you before you hire him.
    They should have a zeal for their work, and work towards completion of the assigned contract efficiently and successfully.

  30. Annie said,

    on July 15th, 2014 at 9:30 pm

    Finally i quit my regular job, now i earn decent money online you
    should try too, just type in google – bluehand roulette system

  31. Brad said,

    on July 26th, 2014 at 2:58 am

    It was hard to find your page in google search results.
    I found it on 18 spot, you should build a lot of quality backlinks ,
    it will help you to get more visitors. I know how to help you, just type in google – k2
    seo tips and tricks

Leave a reply


Blog Roll


Top BBC Tech News Items