Meet the Altair · A byte reaches a device
Sending a
byte out.
So far, your programs have changed registers and memory. Now give the computer something else to talk to: a little device with eight lamps.
Begin here: the program is already loaded. Step three times, watching A and the separate lamp device. Predict which instruction will light it up.
Loaded output program · reference card All addresses and bytes here are hexadecimal
| Address | Reference | RAM | Check |
|---|
0100–0102: 3A 03 00 loads address 3 into A.
0103–0104: C6 01 adds one.
0105–0106: D3 01 sends A to output port 1.
The source byte at address 3 starts at 41 decimal. This lesson checks all seven program bytes before executing; the source data can be changed.
This lesson connects an 8080, 65,536 bytes of RAM, and an eight-lamp teaching device at output port 1. The device is an added illustration, not a built-in Altair display. Start again restores the loaded program and initial data, empties the device, clears both counts and history, and stops at PC 0100. It is not the hardware RESET switch.
Two familiar steps. One new destination.
The first instruction loads 41 from RAM address 3 into A. The second adds one, making A = 42. You have done both before.
The third instruction is new: OUT 01H. Read that as “send the byte in A to output port 1.” Our lamp device is connected to that port. It receives 42 and lights the pattern 00101010.
A keeps 42. Sending a byte copies its value; it does not empty the register. RAM stays unchanged too.
The device keeps its own byte.
The lamps are not another view of A. This device stores the last byte it receives. It keeps showing that byte while the processor does other work.
Try another run with different data. While stopped, use the panel to EXAMINE address 3, then DEPOSIT 99. In binary, 99 is 01100011: raise only switches 6, 5, 1, and 0 for the deposit. The RAM[3] readout will confirm it.
Next, raise only switch 8 and EXAMINE 0100 to return PC to the start. Step the load and the addition. A becomes 99, then 100, while the device still shows 42. The next OUT sends 100; only then do its lamps change.
Port 1 is not address 1.
The 8080 has separate instructions for memory and ports. STA 0001H would store A in RAM at address 1. OUT 01H sends A through output port 1 instead. The number 1 identifies two different destinations.
Look at RAM[1] above: sending 42 or 100 did not change its zero. You can EXAMINE address 1 and DEPOSIT a different byte there; that changes RAM, without sending anything to the device.
Open Look inside the last instruction just after OUT. The trace first shows the reads that fetched D3 01 from program memory. Then it shows a separate output transfer. Values in this trace are hexadecimal: 42 decimal appears as 2A.
The port’s connection is part of this machine’s setup. The processor sends a byte; the connected device decides what to do with it. Here, it keeps the byte and shows its bits as lamps.
Dark lamps can still mean a message.
At the beginning, “No byte sent yet” means the device has received nothing. A transmitted zero is different: its eight bits are all zero, so all eight lamps are dark, but the device has received a byte.
To try it, DEPOSIT 255 at address 3 (all eight lower switches up), EXAMINE 0100, and run the program. Adding one wraps 255 to 0, as before. OUT then sends that zero. The device’s readout and write count distinguish it from the empty starting state.
What this view models
This eight-lamp device is a teaching addition, not a particular historical Altair peripheral or part of its front panel. The red panel lamps still show PC and RAM at PC; the separate amber lamps show the output device’s stored byte. RUN, STOP, and stepping use the same whole-instruction model as the previous lesson. The lesson stops at 0107, just after OUT; no halt instruction runs. Start this lesson again restores the program and source byte, empties the device, and clears the counts and history.