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
These seven bytes are already loaded at 0100. RAM shows what is stored now.
AddressReferenceRAMCheck

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.

Operate the memory panel

The 8080 behind the panel

A decimal
0
PC hex
0100
RAM[3] decimal
41
RAM[1] decimal
0

A separate lamp device Output port 1

No byte sent yet. 0 writes received.

Each OUT sends A here. The device keeps that byte until another arrives. Lit = 1; dark = 0 after a byte has arrived.

The program is loaded. Enable JavaScript to run or step it.

Last CPU instruction

No instruction has run.

Look inside the last instruction
Step an instruction to see its fetched bytes, memory accesses, and any port transfers.
Recent instructions

0 instructions executed.

    RUN and STOP are teaching controls at instruction boundaries. Pace is for reading, not a simulation of the Altair’s clock. This page stops running when hidden. Looking at these readouts changes no state; EXAMINE changes PC.

    EXAMINE changes PC without running a program instruction. Stepping advances PC, and the panel lights follow it. This added control executes a whole instruction; the original SINGLE STEP switch advanced one machine cycle.

    ALTAIR 8800

    Memory controls · learning view

    Address lights The selected location

    0 decimal · 0000 hex

    Data lights The byte at that location

    0 decimal · 00 hex

    A lit lamp is 1; a dark lamp is 0. The digits help you read the lights.

    Data / address switches Up = 1 · Down = 0

    15–8 · Address only

    7–0 · Address or data

    All switches as an address
    0 decimal · 0000 hex
    Lower eight as a byte
    0 decimal · 00 hex

    Setting the switches prepares a number. It does not read or write memory.

    Raise only switch 8 and press EXAMINE to select 0100.

    Select the address in the switches and read its byte.

    Move to the next address and read its byte.

    Write the lower eight switches to the selected address.

    Move to the next address, then write the lower eight switches.

    EXAMINE would select address 0. DEPOSIT would write 0 to the selected address, 0.

    Last memory operation

    Enable JavaScript to operate the panel.

    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.