Lately I found myself wondering what hardware was required for the Altair to get BASIC up and running.
- CPU-Card with 1 KiB RAM
- 4 KiB RAM Card
- Serial Interface
To have some space for any user program second 4 Ki card would come handy. And in fact, this is as well the configuration for which BASIC was offered at a lower price:
75 USD instead of 500 USD when purchased with an Altair computer, an interface board, and 8K of memory
Did MITS manufacture these cards directly or were there already 3rd party options available?
Since the (later) S100 bus was defined with the Altair, it would have needed a psychic to get compatible cards out right away :) So, no, it took some time until others were supplied.
Old Price lists offer some insight here - as long as one keeps in mind, that some of the early entries were pure vapour ware - or came only into existence quite in late 1975 or way into 1976.
MITS' initial offering contianed
- 88-SIO-x, a COM2502 based serial interface card, available as RS232(-A), TTL(-B) or TTY(-C)
- 88-4PIO, a M6820 based parallel port card, delivered with one PIO, prepared to hold 4.
- 88-ACR, a (casette) tape interface (to be used with a 88-SIO-B board)
- 88-4MCS, a 4 KiB static RAM board using 32 2102 (1 Kix1) RAMs
- 88-4MCD, a 4 KiB dynamic RAM board using 8 TMS4030 or 2107A (1 Kix1) DRAMs (Oct 1975)
- 88-VI, a Vector interrupt card
There was, AFAIK, as well offerings for 1 and 2 KiB RAM kits, but AFAIR they were simply the same as the 4 KiB static (88-4MCS), just with less RAM chips supplied.
Until mid 1976 this was expanded with
- 16 KiB static RAM
- Multiport serial card
- Real time clock
- ADC card
- Disk controller
- Printer interface
But at that time many more and better cards were available from other manufacturers.
Also, wouldn't some kind of RS-232 serial or teletype interface be required?
Yes, some. For example with the 88-SIO-C a TTY could be used for loading from paper tape, as well as acting as terminal. To use the cassette version, another serial interface was needed (88-SIO-B) to drive the 88-ACR interface. Alst but not least, BASIC could of course be put into a set of PROMs to have it at power on.
Wikipedia (somewhat cryptically) says
The finished interpreter, including its own I/O system and line editor,...
but I'm unclear what this really means. Was BASIC hard-coded to use a specific memory mapped IO card? If so, was there really any choice of card? If not, how did BASIC handle input/output?
Back then, software was at the same time less hardware dependant and less complex. To run BASIC, one had to supply a set of in/output functions and patch certain locations with calls to these functions. Keep in mind, the Altair had no OS or BIOS or whatsoever at all. it was bare hardware, to be started by toggling in a loader.
How is it done:
Basic 4K BASIC had two routines for character based terminal I/O,
OutChar (more exact
WaitTermReady) to output a character and
InputChar to read one. They were written for an interface with two I/O ports, one status and one data port. Status port bit 7 was checked to see if a character could be outputted, while status port bit 1 if there's an input ready. By default it was assembled with I/O Port 0 for status and 1 for data.
This would indeed fit a 88-SIO card jumpered at I/O-Adress 00h, thus such a configuration would run 4K BASIC right from the tape.
If the 88-SIO card was jumpered for a different address, the corresponding IN/OUT locations had to be patched (*1).
If one used a UART with a different port structure and or status signalling, but still I/O space based and simple access, new I/O routines had to be added, and according jumps patched into the start for either I/O function.
Sounds complicated? Yes, but keep in mind, this is your first computer and your first real application software, spending 10-15 minutes active bringing it up is not only exiting, it also seams total normal.
Already early on Micro-Soft improved this by adding 'automatic' configuration. During initialisation the content of the switches was examined and some auto-patching happened.
- All switches down - 88-SIO at address 00/01h was assumed
- A14 up - Older Version of 88-SIO at address 00/01h
- A13 up - 88-PIO at address 00/01h
- A12 up - 88-4PIO at address 20..23h
- A11 up - 88-2SIO at address 20/21h
Additionally flipping A8 up would make BASIC to take the base address for the card selected from a memory address (0FFFh for 4K, 1FFFh for 8K, 2FFFh for Extended). Of course, one had to toggle it in before executing BASIC :)
This configuration option relieved everyone using MITS hardware from patching (Above #1), only adding the minor step of setting a memory location if one used other than the default ports (above #2).
Basically the same settings were to be used for the checksum loader ... after manually correcting them when entering the first tage loader. Come on, it's easy.
*1 - Patching can happen in many ways and depended on the medium.
With paper tape, one could try to modify the original at these locations by overtyping (or rather punching the holes manually). This works fine with a 88-SIO card, as all higher bits are cleared, and bit 0 is always the same.
Or (more advisable) one duplicated the tape (and leave the original untouched), but changed either IN/OUT address. This became necessary if complete different addresses and/or different status bits were to be used.
Or do it in RAM: One loaded BASIC, patched the changes in memory and dumped it again to (paper/cassette) tape. After all, the 'file' was just a memory dump anyway. For cassette based BASIC this was the only way. Similar if the patch had to include more code like for a different terminal connection.
Of course, one could always just load the code and patch it prior to every use. That's just a few more switch flips, not really worth all the hassle of patching a paper tape or saving that stuff again :))