Wednesday, March 25, 2009

Misc : My 10 Awesome Things I Remember About Computers

Inspired by Scott Hanselman's 10 Awesome Things I Remember About Computers:

OK - there's more than 10 and some have overflowed to another blog entry ...

"Pong (marketed as PONG) is one of the earliest arcade video games, and is a tennis sports game featuring simple two-dimensional graphics. The aim is to defeat an opponent—either computer-controlled or a second player—by earning a higher score."


"A punch card or punched card (or punchcard or Hollerith card or IBM card), is a piece of stiff paper that contains digital information represented by the presence or absence of holes in predefined positions. ... It was used through the 20th century in unit record machines for input, processing, and data storage. Early digital computers used punched cards as the primary medium for input of both computer programs and data, with offline data entry on key punch machines."

You punched them on a machine like this:

and read them on a machine like this:

They were stored in a box like this with different programs secured by a rubber band. This was in fact the earliest example of a code repository!


"CompuServe, (CompuServe Information Service, also known by its acronym CIS), was the first major commercial online service in the United States. It dominated the field during the 1980s and remained a major player through the mid-1990s".

The original TTY screens were navigated via numeric menus. You navigated to forums via the magic word "Go" e.g. "Go Microsoft" or "Go Novell".

BASIC Computer games

This book was written by David Ahl and was the first million-selling computer book. The book contained the source code of a number of games in BASIC and I typed them into a early IBM PC (running GWBASIC) and then spent many happy hours playing the games.

The table of contents and the source code can be found here. And no, you couldn't scan the source in - this was 1978 dude!


This was another BASIC game that I spent hours playing.

"Star Trek is a text-only computer game that originated within the BASIC programming language hacker culture of the 1970s."

"The rules to the game are fairly simple. You are the commander of the starship USS Enterprise (NCC-1701) and have the obligation of eliminating the Klingon menace so democracy in the galaxy can be maintained. The original game existed within an 8-by-8 grid of the galaxy. The entire galaxy contains 64 quadrants and each quadrant contains 64 sectors. The starship can move either between sectors or between entire quadrants using text commands. The ship has a maximum number of energy units, which are used to move the ship, power the ship's shields, and fire phasers. The object of the game is to destroy all the Klingon ships within the galaxy without the Enterprise itself being destroyed."

The beauty of it all was that I had the source so if I wanted more photon torpedoes, I didn't need a cheat code - I simply hacked the code.

There is a version of this game included in the BASIC book above called Super Star Trek.

Hunt the Wumpus

"Hunt the Wumpus is an early computer game, based on a simple hide and seek format featuring a mysterious monster (the Wumpus) that lurks deep inside a network of rooms."

Another game that I spent hours playing and messing around with the BASIC source code. It's been ported to many languages - there's a C# version here.

First IBM PC

"The first IBM PC ran on a 4.77 MHz Intel 8088 microprocessor. The PC came equipped with 16 kilobytes of memory, expandable to 256k. The PC came with one or two 160k floppy disk drives and an optional color monitor. The price tag started at $1,565, which would be nearly $4,000 today." That's correct - it did not have a hard drive.

I bought the technical manual which had a full listing of the operating system - written in 8086 assembler of course - and I rapidly became proficient in using the features of the operating system. The MS-DOS API did most things via a call to INT 21h.


AH=9h DS:DX=pointer to '$' terminated string WRITE STRING

setting the AH register to 9h and pointing DS:DX to a "$" terminated string and executing a INT 21h call caused the string to be written on the console. Everything was accessible by these calls meaning that the hardware could be driven directly. Often (especially for games) the standard OS calls were too slow so developers implemented their own drivers. So much fun - those were the days!

Developers had an intimate understanding of how the PC worked and consequently write better and more efficient code. The code had to be compact because there was virtually no memory.

Computer Bismarck

"Computer Bismarck is the first computer game by Strategic Simulations, Inc., who developed and published it in 1979. It simulated the Bismarck Chase, with the player commanding the British forces; the relatively simple artificial intelligence (AI) opponent (named Otto von Computer) controlled the German battleship Bismarck."

I used to play it on a friend's TRS-80. SSI went on to publish a range of computer games (including the "Panzer General" series) but this was the one that turned me on.

It came on a 32K cassette or a 48K disc and cost something like $59.95.


"Mosaic is the web browser credited with popularizing the World Wide Web. It was also a client for earlier protocols such as FTP, Usenet, and Gopher. Its clean, easily understood user interface, reliability, Windows port and simple installation all contributed to making it the application that opened up the Web to the general public. Mosaic was also the first browser to display images inline with text instead of displaying images in a separate window.

Mosaic was developed at the National Center for Supercomputing Applications (NCSA) beginning in late 1992. NCSA released the browser in 1993."

I'd heard about it on Usenet and one weekend set up my 4800 baud modem to download it. It took the whole weekend! but once I'd got it installed, I realised that I had seen the future and that WAIS, Archie, Veronica, Gopher etc. were all toast.

The first article I read was a tour of the Vatican and the second was Is There a Swimming Pool in the Kremlin?". To summarise:

"A group of reference librarians at a major university library (which shall remain nameless) were a bit skeptical when a WAIS terminal was installed at their reference desk. Not that they were computerphobic.

Far from it, they just felt they were already masters of the best research tools available. So someone posed the question, "Is there a swimming pool in the Kremlin?" Well, in this post-glasnost era, certainly we should be able to find out.

"The reference librarians scurried off to their favorite research mines --some to the card catalog, some to Dialog, some to the periodical indexes. The WAIS wizard worked quietly at his terminal. Within ten minutes, he'd found several citations and one whole article about a retired member of the Red Guard who swam every day, just outside the Kremlin walls. More than half an hour after he'd finished, the librarians straggled back. A few had struck out. A couple had a few cold leads, and one had, with a lot more work, located the same article in about quadruple the time it took on WAIS.

Think they were convinced?"


"CP/M (Control Program for Microcomputers) is an operating system originally created for Intel 8080/85 based microcomputers by Gary Kildall of Digital Research, Inc. Initially confined to single tasking on 8-bit processors and no more than 64 kilobytes (64 KB) of memory, later versions of CP/M added multi-user variations (M/PM) and were migrated to 16-bit processors.

The combination of CP/M and S-100 bus computers patterned on the MITS Altair was an early "industry standard" for microcomputers, and was widely used through the late 1970s and into the mid-1980s. By greatly reducing the amount of programming required to install an application on a new manufacturer's computer, CP/M increased the market size for both hardware and software."

The beauty of CP/M lay in the BDOS and BIOS:

"Basic disk operating system
The Basic Disk Operating System, or BDOS, provided access to such operations as opening a file, output to the console, or printing. Application programs would load processor registers with a function code for the operation, and addresses for parameters or memory buffers, and call a fixed address in memory. Since the address was the same independent of the amount of memory in the system, application programs would run the same way for any type or configuration of hardware.

Basic input output system
The Basic Input Output System, or BIOS, provided the lowest level functions required by the operating system. These included reading or writing single characters to the system consoles and reading or writing a sector of data from the disk. The BDOS handled some of the buffering of data from the diskette, but before CP/M 3.0 it assumed a fixed disk sector size of 128 Bytes, as used on single-density 8-inch floppy disks. Since most 5.25-inch disk formats used larger sectors, the blocking and deblocking and the management of a disk buffer area was handled by model-specific code in the BIOS."

Because these were largely written by you (in 8086 assembler of course), CP/M could be made to run on any hardware. I worked for a company that imported mini-computers from the US of A and we grabbed a damaged mother board and a spare monitor and keyboard and two of us software geeks hooked up with one of the hardware guys to try and get CP/M running on it. The gurus in the States said it couldn't be done. The hardware dude fixed the mother board and changed the memory mapping so that it had a large chunk of contiguous memory and we imported a copy of CP/M from the States.

The first problem was that we didn't have a 8086 assembler so we wrote a cross-assembler that run on the mini. Then we wrote the BDOS and BIOS that enabled CP/M to communicate with our hardware. We had a number of problems and ended up writing our own debugger as well.

We got to the point that everything was sort-of-working but it was working well enough for us to use the CP/M editor, assembler and debugger to debug the system and one glorious day it all worked.

We bought a few games and played them and it sat in the corner for years for people who wanted to play Star Trek at lunch times but we never went much further. All the fun was in getting it to work!

And then of course MS/DOS came along and CP/M was history.

Gopher, Veronica, Archie, Jughead and WAIS

No, it's not a coincidence that some of these are names from the Archie comics.

This was the Internet until the browser came along. Everything was text-based and essentially non-graphical. The fact is that it worked pretty well. It just wasn't whizzy enough!


"Gopher is a distributed document search and retrieval network protocol designed for the Internet. Its goal is to function as an improved form of Anonymous FTP, enhanced with hyperlinking features similar to those of the World Wide Web.

The Gopher protocol offers some features not natively supported by the Web and imposes a much stronger hierarchy on information stored on it. Its text menu interface is well-suited to computing environments that rely heavily on remote computer terminals, common in universities at the time of its creation in 1991 until 1993."

It was developed at the University of Minnesota. In the early days of the web, it provided a hierarchical way to search documents. With the arrival of the browser, it's popularity fell away and there are currently about 125 Gopher services still in existence. Its lack of popularity is shown by the fact that IE no longer supports it.

e.g. gopher:// is a valid URL (like http: https: ftp:).


"Veronica is a search engine system for the Gopher protocol, developed in 1992 at the University of Nevada, Reno.

Veronica is a constantly updated database of the names of almost every menu item on thousands of Gopher servers. The Veronica database can be searched from most major Gopher menus.

The name, although officially an acronym for "Very Easy Rodent-Oriented Net-wide Index to Computer Archives", was chosen to match that of the FTP search service known as Archie — Veronica Lodge being the name of another character from the Archie Comics."


"Archie is a tool for indexing FTP archives, allowing people to find specific files. It is considered to be the first Internet search engine. The original implementation was written in 1990 at McGill University in Montreal.

The earliest versions of Archie simply contacted a list of FTP archives on a regular basis (contacting each roughly once a month, so as not to waste too much resources on the remote servers) and requested a listing."

The World Wide Web made searching for files much easier, and there are currently very few archie servers in operation.


"Jughead is a search engine system for the Gopher protocol. It is distinct from Veronica in that it searches a single server at a time.

Jughead is officially an acronym for Jonzy's Universal Gopher Hierarchy Excavation And Display, though it was originally chosen to match that of the FTP search service known as Archie — Jughead Jones being the name of another character from the Archie Comics.

Jughead was developed at the University of Utah."


"Wide Area Information Servers or WAIS is a client-server text searching system that uses the ANSI Standard Z39.50 Information Retrieval Service Definition and Protocol Specifications for Library Applications" (Z39.50:1988) to search index databases on remote computers. It was developed in the late 1980's.

Public WAIS was often used as a full text search engine for individual Internet Gopher servers, supplementing the popular Veronica system which only searched the menu titles of Gopher sites."

Visual C++ 1.0 on Windows 3.1

I can well remember the day we got the box containing the new-fangled Visual C++ with IDE, debugger etc. We must have been among the first people in the country to purchase it. Up to that point, we'd used command line C to compile and a reasonably simple DOS editor called Brief to write the code. For Windows 3.1, we first used to design the screen on graph paper, then manually count the pixels and then code the screen layout. It was a huge pain to change anything.

None of us had any object oriented exposure so we started off by using Visual C++ to design the screen using drag-and-drop and then used the resulting .res / .rc files as the input to a C program (which compiled inside a C++ wrapper).

Just the fact that everything was integrated in one IDE was a huge time-saver but none of us actually ever got round to using C++!

Friday, March 20, 2009

MSIL : Running MSIL code inside Visual Studio

Using Visual Studio 2005.

Project Create - choose Visual C++ and then "Makefile Project".

This simple example will add two numbers so call the project AddTwoNum.

This bring up a wizard.

Click "Next". For Debug settings, in the "Build Command Line" type:


Then click "Finish".

In the Solution Explorer, delete "readme.txt".

Add a text file called "Build.bat" to the project.

It contains:

ilasm /nologo /debug

(ilasm is the command line MSIL assembler).

Add a text file called "" to the project.

It contains:

.assembly AddTwoNum {}

.method static public void main() il managed

.maxstack 10

.locals init (int32 firstNum,
int32 secondNum,
int32 resultNum)

ldc.i4 11
stloc firstNum
ldc.i4 22
stloc secondNum
ldloc firstNum
ldloc secondNum
stloc resultNum

ldstr "{0} + {1} = {2}"

ldloc firstNum
box int32

ldloc secondNum
box int32

ldloc resultNum
box int32

call void [mscorlib]System.Console::WriteLine(string, object, object, object)

// This bit just waits for a key to keep the command line prompt open

ldstr "Press Enter to continue"
call void [mscorlib]System.Console::WriteLine(class System.String)

// Call the System.Console.Read function
call int32 [mscorlib]System.Console::Read()

// The pop instruction removes the top element from the stack.
// (remove number returned by Read() function)


Now press "F6". Project should assemble cleanly.

Press "F5" to run it.

Answer "Yes" to "The project is out of date - Rebuild?"

Command prompt will display:

11 + 22 = 33
Press Enter to continue

You can set breakpoints in the normal way, step through the code in the usual way and the "Locals" debug window will display the values of the three variables.


Monday, March 16, 2009

Java : Checking version on your PC

Came across a nice feature that does this from the Sun web site.

Verify Java installation

If your installation is out-of-date, just click on the link and the latest one is installed.

Very handy!


Thursday, March 12, 2009

XP : TortoiseSVN and Explorer

We've moved from VSS to Subversion and I downloaded TortoiseSVN as my Windows client.
Every time I right-clicked on a folder, I get"

"Windows Explorer has encountered a problem and has to close"

Mr. Google to the rescue - took me a while - but eventually I discovered that the problem was with PowerDesk which I rarely use anymore.

So I uninstalled it and now all is well!


Misc : A good day on Stackoverflow

Check this out.

100 rep - 3 badges - heck, I can live with that.


Friday, March 06, 2009

Misc : Google Sites

OK - have a home page on Google Sites:

Home page


Misc : Top Google search result

Searching Google for "DOS grep equivalent" shows "Random thoughts and collisions" is the top dog!

It's 1 out of about 62,000.

Check it out by double-clicking on the image above.