The last time Hackerfall tried to access this page, it returned a not found error. A cached version of the page is below, or click here to continue anyway

Great Australian software developers: Nick Gammon & G-Pascal - SuperCoders

In the late 1970s I was using a hand-soldered computer based on a Motorola 6800 Evaluation Kit. This predated pre-assembled things like the Tandy TRS-80 or the Commodore Pet. Basically it was well before personal computers were commonly heard of in Australia. Here is a photo of the old Motorola board:

This 'PC' had about 16Kb of RAM (from memory) and 16 Kb of EPROM. Here is the board with the EPROM's on it:

The extra 16 Kb RAM board & another 16K "Mother Board":

  

My first task was to write an assembler and editor, as it had virtually no software with it, except for a BIOS in ROM - about 256 bytes or so.

Since it didn't have an assembler to start with, I had to write the assembler in hex machine codes initially. Once that worked, each version of the assembler could be used to develop the next one. The editor/assembler took up 8 KB between them, so each version used up half of the onboard EPROM, and I used that half to burn the next version in the other half, and then swap them over to "upgrade" it. Here's how I programmed the assembler in hex:

Although I had written an assembler for my Motorola PC in October 1978, I had no experience in writing compilers, and was becoming increasingly interested in adding a proper high-level language to its repertoire.

I had been using BPL (Burroughs Programming Language) at the place where I worked, and found the structured approach in such a language much easier to work with than assembler code.

I had no idea, however, how to go about writing such a thing. That was when I spotted an article about 'A Tiny Pascal Compiler', an article written by Kin-man Chung and Herbet Yuen, published in the September, October and November 1978 issues of Byte Magazine (refer to links at bottom of this page). They described how they had made a cut-down version of Pascal, implemented in the Basic language. It sounded interesting but was apparently very slow, no doubt as a result of trying to write a compiler in Basic. They reported that their compiler compiled about 8 lines per minute.

The useful thing about this article was that they described in great detail about how such a compiler would be implemented, gave syntax diagrams, and had the source code of their compiler. Having read the article I thought I understood how it worked, and decided to do my own version, in assembler, on my little PC. It was quite a long project, but at least I already had a text editor, so I could get straight on with the compiler.

The compiler actually generated P-Codes (Pseudo-machine code) which was not real machine code but code for a hypothetical machine, which an 'interpreter' then processed. This simplified things somewhat as I did not need to be concerned with actually generating machine instructions.

Thus, the running a program consisted of two steps: first, compiling the source code into P-Codes, and secondly, interpreting the machine codes. The compile step only had to be done once, so to repeatedly run a program you could go straight to the interpret step each time.

After a few weeks work, I had it working, and it turned out to be much faster than their 8 lines per minute. Mine worked at around 2,000 lines per minute, which meant that even a largish program (eg. 200 lines) would compile in about 6 seconds. This I also put into EPROM (it took 8 Kb) so that my 16 Kb EPROM board was now full. It had:

*1 Editor: 4 Kb

*2 Assembler: 4 Kb

*3 Pascal Compiler and Interpreter: 8 Kb

This was the first, (and only that I know of), computer that had a Pascal compiler in ROM (EPROM), so that after turning it on you could program in Pascal instantly.

Unfortunately, my editor, assembler and compiler were designed rather specifically around my exact configuration (keyboard, monitor card, memory configuration), and thus I was not in a position to sell it. Thus, it was just a once off.

Saving of files (like the source code) was to a magnetic tape - I had a tape-recorder connected to the PC, and had to manually hit "record" and then start the save process.

In 1982 I thought it was time to try to make some money out of my ability to write compilers, so I decided to 'port' my Pascal compiler from the Motorola 6800 to the Apple II. This was not a totally trivial task, as the two computers had different chips in them. The Motorola had a 6800 chip, and the Apple had a 6502. The instructions were different but not completely different. For example, the 6502 did not have a B register.

After a few weeks work I had the Pascal compiler working, so I decided to call it G-Pascal. The 'G' stood for Gammon. I once tried to register G-Pascal as a trademark, but apparently the letter 'G' was not enough of a distinguishing mark. In other words, you cant trademark individual letters of the alphabet. Interestingly I believe Apple these days are able to trademark the iPhone, which is basically just the letter "i" attached to an existing word "Phone". Since they can protect that mark, but I could not trademark "G" attached to "Pascal" perhaps they had better lawyers than me.

The program only took up 12 Kb of memory when loaded. In that space was the editor, compiler and P-code interpreter. It didn't need the assembler, as that was only needed to compile the G-Pascal.

I wrote a user manual for G-Pascal, and printed it out on our dot-matrix (Brother Microline 84) printer. We then photocopied a few dozen copies, and used a binding machine to put ring binders on them. We bought some plastic bags from Venus Hartung, copied some disks, and were ready to sell!

I took out ads in the Australian Personal Computer magazine (refer to links), and also Your Computer (refer to links), I think. I am as good an advertising copywriter as a salesman, so my ads were not very enticing (refer to links). I concentrated on giving as much technical detail, in fine print, as I could, whereas I think a better approach would be to make a more eye-catching ad, and mail details to people when they expressed interest.

Still, a few dozen copies of G-Pascal were sold. They may have covered the cost of the advertising, but I doubt it.

In August 1982, the Australian-based 'Your Computer' magazine printed a program I wrote to demonstrate writing an adventure game in G-Pascal (refer to links). The article ran to 6 pages of fine print, taking up quite a bit of room in the magazine and giving us lots of exposure.

We also got a favourable review of G-Pascal (for the Apple II) in August 1982. It was described as an 'interesting and extremely useable small language package', 'compact but particularly potent package', and 'amazing value for money'.

In April 1983 I was contacted by Ian Webster, the editor of Australian Personal Computer magazine, and met him at some trade show or other.

He had seen my G-Pascal for the Apple II, and suggested that the new state-of-the-art computer would be the Commodore 64. As it had the same chip as the Apple II (the 6502) he suggested I port G-Pascal to the Commodore 64.

I bought a Commodore 64, and I also developed a method of transferring files from the Apple II to the Commodore 64 via the parallel port. This meant I could keep using the assembler that I had purchased for the Apple, but assemble programs for running in the Commodore 64. At this stage my Apple II had a floppy disk drive, and the assembler was more potent (Merlin I think it was called), which simplified the assembly part of the process.

The transfer method involved loading a small 'transfer' program onto both PCs, and then initiating a 'send' or 'receive'. Transferring via the parallel port was very fast, so the whole G-Pascal could be sent in a couple of seconds.

The Commodore 64 version had extra features to support the hardware on that PC. In particular, I added stuff to let you handle sprites, the colour screen, and the sound chip. This extra stuff took about another 4 Kb, so I think the whole G-Pascal took up 16 Kb.

In the November 1983 issue of "Your Computer" we got a very favourable review of G-Pascal for the Commodore 64 (refer to links). Amongst other things the reviewer said our program 'provides outstanding support for all the features of the system', 'support for graphics, sprites and sound is superb' and finally 'you may have heard that Australian programmers are as good as any, here is the evidence'.

In the end, I think I sold around 2000 copies of G-Pascal. It made some money certainly, but quite a bit was swallowed up by advertising, and I probably would have made more by just working full-time, so I eventually went back to doing that.

After working full-time for a long time, I got interested in MUD games, and wrote my own MUD client (MUSHclient) which I presume you have seen on my web site. That is still my ongoing interest.

More recently I discovered the Lua scripting language, which is now incorporated into MUSHclient.

The funny thing is, as soon as I saw the Lua syntax I thought "oho! this looks like Pascal". The syntax is certainly remarkably similar. The repeat ... until loops, the while ... end loops, etc. There are differences, certainly, but somehow seeing Lua reminds me of my G-Pascal days. :)

Lua also uses the P-code approach - it compiles into P-codes and interprets them, like G-Pascal did.

Unfortunately I think I threw out the old hand-written assembler. That was an interesting job - coding an assembler using pencil and paper. I got good at memorizing the hex codes for common instructions.

Copyright &copy SuperCoders 2010 - 2011 All Rights Reserved.

Continue reading on supercoders.com.au