| Field | Length | Card Col | Print Col | Punch Col | Literal Text |
|---|
| # | Cond | Source | Op | Dest | Sel | Sequence | Arg |
|---|
The 1004 is programmed by wiring a removable plug-board with 31 sequential program steps. There is no stored program in core memory — your "code" is the wire arrangement.
Field Definitions: Define up to 8 named data fields by their card-column, print-column, punch-column, and length. These act as named buses for source/destination wiring. A field with card‑col 0 reads no card data. If you fill in Literal Text on such a field, the source emits that text — useful for printable labels like TOTAL = .
Program Step Wiring: Each step is one row. For each step you select:
| Slot | Meaning |
|---|---|
Cond | Pre-condition: ALWAYS, S1–S4 ON/OFF, EQ/NE/LT/GT flag, EOF, Cn=0, Cn≠0. Step is skipped when false. |
Source | What hub to read from: a field, a counter, ZEROS/BLANKS, or digit emitters E1..E9 (each emitting "0000n" — useful for counter increments). |
Op | MOV (transfer), ADD (BCD add), SUB (BCD subtract), CMP (compare, sets flags). |
Dest | Where to write: PRINT bus (uses field's Print Col), PUNCH bus, a counter, or "—" for compare-only. |
Sel | For CMP only: which selector to set. Conventions: S1=src<dst, S2=src=dst, S3=src>dst, S4=src≠dst. |
Sequence | What happens after this step's transfer: |
NEXT = step+1 (default) | |
JUMP n = jump to step n in the same card cycle | |
NEW-CARD = print buffer is sent, next card is read, step counter resets to 1 | |
PRT-LINE = eject a printed line, then NEXT | |
PCH-CARD = punch a card from the punch buffer, then NEXT | |
HALT = stop the processor |
Counters (1-4) are 5-digit BCD registers. ADD/SUB into a counter accumulates; MOV sets it. To increment a counter by 1, use source E1 with op ADD. To test for zero, use condition Cn=0.
Selectors (S1-S4) are flip-flops set by CMP (per the Sel slot). Conditions on later steps test them via Sn ON / Sn OFF.
End-of-File: When the hopper empties, EOF lamp lights. The condition EOF=YES tests it (your final-totals step uses this).
Card cycle: Steps 1..31 execute per card. NEW-CARD on any step ends the cycle and starts again at step 1 with the next card. The card cycle iterates until EOF or HALT.