Creating a Christmas card on a vintage IBM 1401 mainframe

I recently came across a challenge to print a holiday greeting card on a vintage computer, so I decided to make a card on a 1960s IBM 1401 mainframe. The IBM 1401 computer was a low-end business mainframe announced in 1959, and went on to become the most popular computer of the mid-1960s, with more than 10,000 systems in use. The 1401's rental price started at $2500 a month (about $20,000 in current dollars), a low price that made it possible for even a medium-sized business to have a computer for payroll, accounting, inventory, and many other tasks. Although the 1401 was an early all-transistorized computer, these weren't silicon transistors—the 1401 used germanium transistors, the technology before silicon. It used magnetic core memory for storage, holding 16,000 characters.

A greeting card with a tree and "Ho Ho Ho" inside, created on the vintage 1401 mainframe. The cards are on top of the 1403 line printer, and the 1401 mainframe is in the background.

A greeting card with a tree and "Ho Ho Ho" inside, created on the vintage 1401 mainframe. The cards are on top of the 1403 line printer, and the 1401 mainframe is in the background.

You can make a greeting card by printing a page and then folding it into quarters to make a card with text on the front and inside. The problem with a line-printer page is that when you fold it into a card shape, the printed text ends up sideways, so you can't simply print readable text. So I decided to make an image and words with sideways ASCII graphics. (Actually the 1401 predates ASCII and uses a 6-bit BCD-based character set called BCDIC, so it's really BCDIC graphics. (EBCDIC came later, extending BCDIC to 8 bits and adding lower case.)) Originally I wanted to write out "Merry Christmas", but there aren't enough characters on a page to make the word "Chrstmas" readable, so I settled on a cheery "Ho Ho Ho". I figured out how to sideways draw a tree and the words, making this file.

Closeup of a greeting card printed on the IBM 1401, with a Christmas tree on the front.

Closeup of a greeting card printed on the IBM 1401, with a Christmas tree on the front.

Next, I needed a program to print out this file. I have some experience writing assembly code for the IBM 1401 from my previous projects to perform Bitcoin mining on the 1401 and generate Mandelbrot fractals. So I wrote a short program to read in lines from punched cards and print these lines on the high-speed 1403 line printer. The simple solution would be to read a line from a card, print the line, and repeat until done. Instead, I read the entire page image into memory first, and then print the entire page. The reason is that this allows multiple greeting cards to be printed without reloading and rereading the entire card deck. The second complication is that the printer is 132 columns wide, while the punch cards are 80 columns. Instead of using two punch cards per print line, I encoded cards so a "-" in the first column indicates that the card image should be shifted to the right hand side of the page. (I could compress the data, of course, but I didn't want to go to that much effort.)

The 1401 has a strange architecture, with decimal arithmetic and arbitrary-length words, so I won't explain the above code in detail. I'll just point out that the r instruction reads a card, mcw moves characters, w writes a line to the printer, and bce branches if a character equals the specified value. (See the reference manual for details.)

The next step was to punch the code and data onto cards. Fortunately, I didn't need to type in all the cards by hand. Someone (I think Stan Paddock) attached a USB-controlled relay box to a keypunch, allowing a PC to punch cards.

A PC-controlled IBM 029 keypunch punched my card deck.

A PC-controlled IBM 029 keypunch punched my card deck.

A few minutes later I had my deck of 77 punch cards. The program itself just took 9 cards; the remainder of the cards held the lines to print.

The deck of punched cards I ran on the IBM 1401. The first few cards are the program, and the remaining cards hold the lines to print.

The deck of punched cards I ran on the IBM 1401. The first few cards are the program, and the remaining cards hold the lines to print.

Once the cards were ready, we loaded the deck into the card reader and hit "Load", causing the cards to start flying through the card reader at a dozen cards per second. Unfortunately, the reader hit an error and stopped. Apparently the alignment of the holes punched by the keypunch didn't quite match the alignment of the card reader, causing a read error.

The IBM 1401's card reader was experiencing errors, so we removed the brushes and realigned them.

The IBM 1401's card reader was experiencing errors, so we removed the brushes and realigned them.

The card reader contains sets of 80 metal brushes (one for each column of the card) that detect the presence of a hole. Computer restoration expert Frank King disassembled the card reader, removed the brush assembly from the card reader and adjusted it.

A closeup of the brush module with 80 brushes that read a card.

A closeup of the brush module with 80 brushes that read a card.

After a few tries, we got the card reader to read the program successfully and it started executing. The line printer started rapidly and noisily printing the lines of the card. We had to adjust the line printer's top-of-form a couple times so the card fit on the page, but eventually we got a successful print.

Printing a greeting card on the IBM 1403 line printer.

Printing a greeting card on the IBM 1403 line printer.

I ejected the page from the printer, tore it off, and folded the card in quarters, yielding the final greeting card. It was a fun project, but Hallmark still wins on convenience.

Greeting card created by the IBM 1401 mainframe (background).

Greeting card created by the IBM 1401 mainframe (background).

If you want to know more about the IBM 1401, I've written about its internals here. The Computer History Museum in Mountain View runs demonstrations of the IBM 1401 on Wednesdays and Saturdays. It's amazing that the restoration team was able to get this piece of history working, so if you're in the area you should definitely check it out; the demo schedule is here.

Follow me on Twitter or RSS to find out about my latest blog posts.

19 comments:

Anonymous said...

Nerd!

JD said...

It might look archaic, and require tweaking now and then, but that old 1401 plus peripherals is still running. If you bought a PC today with firmware in flash ROM, hard drives with insane aerial densities, cost optimized electronics, and a laser printer, I sincerely doubt it would still be able to boot and print a Christmas card in ~60 years! I wonder if the LCD monitor would even work, or would the chemistry cease operating after the rumored ~20-30 years? I wonder how much money it would cost today to manufacture the 1401 with it's peripherals - as-is - no cost reductions or simplifications?

Thanks for the post! Computers are disposable now...

Unknown said...

this is so cool, did you also write a test program to find the boundaries of the page for calibration?

Anonymous said...

132 columns by 66 lines per page!

Unknown said...

Very cool. Where is this old equipment located?

Ken Shirriff said...

Unknown: the 1401 is at the Computer History Museum in Mountain View, CA. Stop by and see it if you're in the area!

Assignment Help said...

I'm getting excited about this kind of beneficial information of your stuff in the future
Dissertation Thesis Help

Anonymous said...

I once worked as an operator - feeding those stacks of punched cards were my main duty, and of course feeding the printer with paper and removing printed pages for the bosses to pick up. Temperature inside the computer room was at freezing!

Anonymous said...

Nice, after busting forms for 4 years I got a job after taking a programming diploma operating with the employer I left to go to school in the mid 80s running an IBM 4341 and and an ICL 2904 96k std upgraded to 128K Range Cobol if I recall, keyboard hardwired to console, don't ask me how I know. Had to load OS from dasd and then overlay, new guy kept forgetting to do the overlay and as soon as he would dismount the ipl dasd crash and 8 unhappy keypunchers with an old battleaxe being the lead one on days. Did a couple more jobs learned MVS got tired of the bad everything except $ and got my CNE and MCSE worked in sys eng and support roles

Anonymous said...

Oh yeah, punch cards loose desk Halon Fire test its raining, what no documentation on the order of the ICL job nightly batch job cards that has to go tonight? really, lucky the senior operator had made macros and new the file inputs and outputs and we figured out what sorts were what with a programmer.

Hans Dohm said...

Very cool to see once more! I cut my teeth on keypunch and sorter repair using feeler gauges ball peen hammers and files. a paint brush and vacuum for the chad and dust. I would love to see an old system 3 back-plane and it's eye popping yellow wire factory! post a pic if you can.

George Mells said...

I started college in 1967 and used 026 series key punches to make programs for the schools IBM 1130. At my first Army assignment in 1973 they had 029s to go with the old IBM 7080 computer that had 1401/1410 systems as its I/O systems. But the unit was changing to Univac 1108 systems with 9200/9300 minicomputers as their I/O systems. They had a super-speed card reader that was great when it worked and drum based line printers that were really loud when full lines were printed. They also had a super fast page eject that made it nearly impossible to keep the output in a stack until they got output stackers.

By the way, you said the program was assembly but could it have been RPG instead? I believe that was the primary language used on the 1400 series computers.

mespoppa said...

I was a student at Auburn University and worked part-time at their computer center between 1963 and 1966. They had a 1403 front-ending an IBM 7040. Their 1401 only had 4K characters of storage. I programmed it in assembly language since we didn't have any compilers for other languages. Auburn didn't have a lot of money to invest in computers at the time. We only had a card reader/card punch attached to the 1401. For printed output, we punched cards and then listed them on an IBM 407 accounting machine.

The IBM 7040 was a binary computer with 36-bit words. I think we had 9 tape drives attached to it. No drum or disk. Memory had an 8 microsecond cycle time.

When I started at the computer center, they only had an IBM 1620. It had 32K digits of memory. That was an interesting computer. The instruction codes used 2 digits. Most instructions except for branch instructions took 2 5-digit addresses. The branch instructions took 1 5-digit address. The multiply instruction used table lookup. You could change the table so you could multiple in other number systems such as binary or octal. It didn't speak hexidecimal though.

I'm not saying the author is incorrect, but I remember the character code being EBCDIC rather than BCDIC, but the E is probably just for Extended. It was over 50 years ago. Now my Kindle has many times the computing power and storage capability.

Ken Shirriff said...

Thanks everyone for the stories. George: while the 1401 supports RPG, we don't have a RPG compiler, so I used assembly. mespoppa: BCDIC is the 6-bit BCD-based code used by the 1401. For the IBM 360, the code was extended to 8 bits, with support for lower case and more symbols; this extended code was EBCDIC.

Gerry Jurrens said...

I thought RPG came along much later, like AS/400 days. Hmmmm..

Rob Taylor said...

Very early in my IT career, when I was working for NASA in Huntsville, Al, I programmed the 1401, and its big brother the 1410, in both assembler (Autocoder) and actual machine language. It used to be real fun sitting at a keypunch machine punching programs in machine language code, and in "loader format"; i.e. the punched card format to load programs into the computer.

Later, when ASCII COBOL came out, it had no direct-access verbs (disk drives were huge and in their infancy) so I was assigned to develop them for the COBOL compiler which was written in 1410 Autocoder. That was some of the most fun in my now 59 year IT career.

George Mells said...

A lot of memories here. My first true hands on experience was at college, Rose Hulman (Rose Poly in my days). In one of the basements was an operational Bendix G-15 computer. This beast was a vacuum tube creation with a rotating drum memory. It had both a paper tape reader and a 1/2 inch tape drive. Basic operation/programming was thru a Selectric typewriter console in machine language. A two digit op code and a digital address. Killed quite a few hours with it. If your not familiar with the G-15 it was shown in the opening credits of one season of the old "Science Fiction Theater" TV series.

Interestingly, one of the biggest features of the Univac 1108 systems the Army bought in 1973 was the 8460 hard drive unit. It was a 3 by 3 by 4 foot cabinet with 24 inch fixed disks and a tremendous 550 megabyte equivalent of storage. And now we have micro SD cards with 128 Gb.

Candra Adi Putra said...

it' would be great if this in video format.. so we can see how this process work.. great stuff . Really Nerdy.. i can't imagine computer before DOS

Ken Shirriff said...

Candra: CuriousMarc put a video of the 1401 card on YouTube here.