2 ms·
My first summer job was a $2/hour "Night Operator" at Transdata, a Phoenix timesharing company. They shut down their timesharing service at night, so after runn
by Stratoscope 1y ago
My first summer job was a $2/hour "Night Operator" at Transdata, a Phoenix timesharing company. They shut down their timesharing service at night, so after running a few batch jobs, I had the SDS Sigma 5 all to myself.
We had a few one-card programs, some fun, some useful. A single card held 80 bytes of machine code.
The Sigma 5 had a small speaker on the front panel that you could toggle between two states to move the cone in or out. How often you toggled it determined the pitch of the sound.
One card was called BIRDS. It toggled the speaker to make it sound like several birds chirping at each other.
A more useful one was PRINT. You put it in front of a deck of cards, ran the deck through the card reader, and it would print the deck.
It was a bit slow, because it used a single memory buffer:
1. Read card 1
2. Print card 1
3. Read card 2
4. Print card 2
5. Read card 3
6. Print card 3
etc.
In other words, at any moment either the card reader or the printer would be operating, not both.
I studied the code and found there were just enough bytes left out of the 80 to implement double buffering by flipping a buffer pointer at each step:
1. Read card 1 into buffer A
2. Print card 1 while reading card 2 into buffer B
3. Print card 2 while reading card 3 into buffer A
4. Print card 3 while reading card 4 into buffer B
etc.
Twice as fast!