Restored 1959 IBM 1401 Inverts Hilbert Matrix With Tape-Based FORTRAN

The IBM 1401 compiles and runs FORTRAN II — CuriousMarc

CuriousMarc

Software subroutines and a 63-pass magnetic tape overlay allow the business-oriented IBM 1401 to execute scientific floating-point calculations despite lacking native mathematical hardware.

AI-assisted summary of The IBM 1401 compiles and runs FORTRAN II — original source. Check the original for full context.

Source published:

Key ideas

  • Restorers at the Computer History Museum successfully compiled and executed a FORTRAN II scientific benchmark on an original 1959 IBM 1401 decimal mainframe. (0:10)
  • Because the IBM 1401's 16K core memory cannot hold the full FORTRAN compiler, the system relies on an intricate 63-pass overlay architecture streaming off magnetic tape. (21:39)
  • The benchmark successfully inverted an ill-conditioned Hilbert matrix and computed an identity matrix using software-synthesized 15-digit floating-point arithmetic. (6:14)
  • To achieve period-accurate operation without modern assist devices during runtime, the team used a custom FPGA-based tape emulator to write historical tape images onto physical magnetic reels before unplugging it. (11:34)

Detailed notes

## Background Published on YouTube by CuriousMarc on February 2, 2018, this video documents an effort to compile and run a FORTRAN program on a vintage 1959 IBM 1401 mainframe at the Computer History Museum. The project tests the limits of the museum's 16K decimal computer, which was engineered for commercial accounting rather than scientific computation.

## TL;DR CuriousMarc and restorer Mike Albaugh work through the steps required to execute FORTRAN II code on the Computer History Museum's IBM 1401 mainframe. To prepare the run, the team constructs a viable physical compiler tape using a custom hardware tape emulator and punches a period-accurate source deck from an emulated tape image using an IBM 1402 and an IBM 026 keypunch. After overcoming an initial parity check and storage error caused by a missing check bit, the team detaches all modern gear to achieve a historically authentic configuration. The 1401 completes all 63 compiler overlay passes from magnetic tape and successfully runs a scientific benchmark that inverts and multiplies an ill-conditioned Hilbert matrix, printing floating-point results on the IBM 1403 line printer.

## Atmosphere & style The video carries an earnest, hands-on workshop energy balanced by deep reverence for early computing history. The rapport between Marc and Mike Albaugh is playful yet technically meticulous, marked by deadpan quips in the face of register parity alarms and genuine awe when the 1950s machine handles floating-point math. Watching the demonstration feels tactile and mechanical—filled with the rhythmic clatter of punched-card hoppers, the hum of vacuum columns, and the sharp strike of line-printer chains delivering a triumphant calculation.

## Bulletin - [00:10](https://www.youtube.com/watch?v=uFQ3sajIdaM&t=10s) Restorers at the Computer History Museum successfully compiled and executed a FORTRAN II scientific benchmark on an original 1959 IBM 1401 decimal mainframe. - [21:39](https://www.youtube.com/watch?v=uFQ3sajIdaM&t=1299s) Because the IBM 1401's 16K core memory cannot hold the full FORTRAN compiler, the system relies on an intricate 63-pass overlay architecture streaming off magnetic tape. - [06:14](https://www.youtube.com/watch?v=uFQ3sajIdaM&t=374s) The benchmark successfully inverted an ill-conditioned Hilbert matrix and computed an identity matrix using software-synthesized 15-digit floating-point arithmetic. - [11:34](https://www.youtube.com/watch?v=uFQ3sajIdaM&t=694s) To achieve period-accurate operation without modern assist devices during runtime, the team used a custom FPGA-based tape emulator to write historical tape images onto physical magnetic reels before unplugging it.

## Key takeaways - [00:10](https://www.youtube.com/watch?v=uFQ3sajIdaM&t=10s) The IBM 1401 is an architecture designed strictly for commercial accounting with a 90 kHz clock and decimal core memory, making scientific computation in FORTRAN an immense technical challenge. - [00:10](https://www.youtube.com/watch?v=uFQ3sajIdaM&t=10s) Rebuilding the physical magnetic tape compiler required roughly a month of daily effort to accurately recreate working media from historical digital archives. - [00:10](https://www.youtube.com/watch?v=uFQ3sajIdaM&t=10s) Loading magnetic tape relies on a physical Beginning of Tape (BOT) reflective marker; failing to detect it will cause the transport to run off the reel during rewind. - [03:42](https://www.youtube.com/watch?v=uFQ3sajIdaM&t=222s) An initial compilation attempt aborted due to missing odd parity on a halt instruction byte, triggering process, reader, and register parity checks. - [06:14](https://www.youtube.com/watch?v=uFQ3sajIdaM&t=374s) Because the 1401 core memory lacks native floating-point math and optional integer multiply/divide hardware, floating-point arithmetic must be entirely synthesized via software routines. - [06:14](https://www.youtube.com/watch?v=uFQ3sajIdaM&t=374s) The test program sets a floating-point mantissa precision of 15 digits and an integer size of 5 digits within an 8,000-character partition on a 16,000-character machine. - [06:14](https://www.youtube.com/watch?v=uFQ3sajIdaM&t=374s) The executed benchmark inverts an ill-conditioned Hilbert matrix, multiplies it by the original to yield an identity matrix, and calculates a second matrix inversion. - [11:34](https://www.youtube.com/watch?v=uFQ3sajIdaM&t=694s) A custom black-box tape emulator capable of mimicking up to six IBM 729 vacuum-column drives allowed an emulated utility to write tape records onto a physical reel. - [16:13](https://www.youtube.com/watch?v=uFQ3sajIdaM&t=973s) The IBM 1402 Card Read-Punch requires cards to be fed 9-edge leading on the reader end and 12-edge leading on the punch end to ensure identical orientation in the output stackers. - [16:13](https://www.youtube.com/watch?v=uFQ3sajIdaM&t=973s) An IBM 026 Keypunch in duplicate mode was used as an interpreter to print human-readable text along the top edge of cards punched by the high-speed 1402 unit. - [20:22](https://www.youtube.com/watch?v=uFQ3sajIdaM&t=1222s) Before starting the live demonstration, the modern tape emulator was completely unplugged to guarantee historically authentic execution purely on vintage hardware. - [21:39](https://www.youtube.com/watch?v=uFQ3sajIdaM&t=1299s) Compiling FORTRAN II on the IBM 1401 requires 63 sequential passes, reading overlays back and forth off magnetic tape before executing the final binary in core memory.

## Detailed walkthrough ### [00:10](https://www.youtube.com/watch?v=uFQ3sajIdaM&t=10s) Attempting FORTRAN on the IBM 1401

At the Computer History Museum in Mountain View, California, Marc and vintage computer restorer Mike Albaugh prepare to compile and execute a program on the museum's IBM 1401 mainframe, specifically the system nicknamed "Connecticut." The IBM 1401 is a business-oriented decimal computer from 1959 with a 90 kHz internal clock, making scientific computation in FORTRAN a massive stretch. The team decides to test the software using the first practical sample program found directly in the original IBM 1401 FORTRAN manual, reasoning that it represents the most sensible baseline for a revival attempt.

Loading the software requires mounting a freshly prepared magnetic tape containing the FORTRAN compiler. The team spent roughly a month of intermittent daily effort just trying to recreate a viable compiler tape. As they mount the reel, there is immediate concern that the Beginning of Tape (BOT) reflective marker might have peeled off or been overlooked during manual threading. If the optical sensor fails to detect the load point foil marker, the drive will fail to halt its rewind cycle and whip the tape clean off the physical reel. Fortunately, the drive senses the reflective tab properly, settles at the load point, and transitions into the ready state.

With the card deck queued in the IBM 1402 Card Read-Punch hopper, reading begins. The 1401 ingests the first few cards and pulses the magnetic tape forward. A momentary pause and a reader check halt the machine; the compiler was attempting to send output to the IBM 1403 line printer before reading the rest of the cards. Once the printer cycle completes, the system resumes card feeding, printing the source statements directly onto the green-bar paper as it pulls them into core memory.

- Machine used: IBM 1401 mainframe ("Connecticut" unit at CHM). - Test subject: First sample program from the original IBM 1401 FORTRAN reference manual. - Input media: Punched card source deck loaded via the IBM 1402 Card Read-Punch. - System software: FORTRAN compiler restored onto an IBM magnetic tape unit.

---

[03:42](https://www.youtube.com/watch?v=uFQ3sajIdaM&t=222s) Parity Errors and the "Try It Again" Fix

After reading through the deck, Mike initiates the usual last-card restart procedure, noting in hindsight that he should have placed an extra blank card at the rear of the card deck. Immediately, the console lights up with alarming warning indicators. Marc announces the sudden failure: “Houston, we have a process error, a reader error, a storage error.” In addition to these major alarms, both the A-register and B-register show parity failure indicators, signaling that core storage logic has violated the machine's strict internal odd-parity checking rules.

```mermaid flowchart TD accTitle: IBM 1401 Parity Check Diagnostic Flow accDescr: Diagram illustrating how reading an invalid character into memory causes parity and storage errors.

subgraph Hardware_Check ["Console Register Check"] A["Console Register Indicator: B, A, 8, 2, 1"] --> B["Identified Character: Period / Halt Opcode"] B --> C{"Parity Bit (C) Status"} end

subgraph Error_State ["Fault Trigger"] C -->|"Bit Missing (Even Parity)"| D["Odd-Parity Rule Violated"] D --> E["Trigger Alarms: Process, Storage, & Reg Parity"] end

subgraph Resolution ["Operator Intervention"] E --> F["Reset Console & Clear Errors"] F --> G["Retry Card Read & Tape Bootstrap"] end ```

Investigating the instruction address registers and the character display cheat sheet, Mike and Marc decode the faulting byte. The machine was executing a load instruction (Opcode `L`), which corresponds to a magnetic tape read routine, and stalled on a character encoded as bits `B, A, 8, 2, 1`. In the IBM 1401 character set, this bit combination represents a period (`.`), which Mike identifies as an assembly Halt instruction. However, memory characters require odd parity, meaning a check bit (`C`) should have been present to keep the total count of active bits odd. Because the parity bit was absent, the memory logic flagged an illegal byte and aborted execution. Rather than tearing down the chassis, they resort to the quintessential computing solution: Marc notes, “We can do the time-honored thing that customer support always tells you to do: try it again!”

- Console error indicators triggered: Process Error, Storage Error, Reader Error, A-Register Parity, and B-Register Parity. - Character evaluated: `B, A, 8, 2, 1` (equivalent to a dot/period `.`, serving as a Halt instruction in 1401 machine code). - Failure root cause: Missing parity bit (`C` bit) violating core memory odd-parity design. - Corrective action: Console system reset, reloading the hopper, and restarting the tape sequence.

---

[06:14](https://www.youtube.com/watch?v=uFQ3sajIdaM&t=374s) Successful Compilation and Hilbert Matrix Execution

The second attempt clears the hurdle cleanly. The tape spins, the IBM 1402 card reader digests the source cards without tripping a check, and the tape drive churns continuously as the multi-phase compiler transforms the FORTRAN statements into executable machine instructions. After completing compilation, the CPU executes an intentional programmed halt. Mike presses the console Start button to run the compiled object code residing in core memory.

The system immediately dives into calculation. Because the 1401 was architected strictly for character-manipulation accounting tasks, scientific computations run at a snail's pace; integer multiplication and division are optional hardware modifications, and floating-point math must be synthesized through complex software subroutines. Marc remarks on the sheer unlikeliness of running scientific software on this architecture: “So Fortran is really a stretch for the 1401. I mean, it's totally amazing that they were able to put it in there.” After a lengthy calculation pause, the 1403 line printer springs to life, hammering out rows of scientific numbers before halting.

Examining the printed continuous form confirms a successful run: 1. **Compilation Header**: Records that 8,000 characters of memory were requested by compilation parameters, while acknowledging the host machine possesses the maximum configuration of 16,000 characters. 2. **Precision Definitions**: Specifies an integer variable size (modulus) of 5 digits and a floating-point mantissa length of 15 digits. 3. **Program Function**: An 800-character source code routine executing complex matrix arithmetic—specifically creating an ill-conditioned Hilbert matrix, calculating its inverse, multiplying it, and inverting it a second time.

A fellow museum restorer walks in, visibly stunned at the sight of scientific output on the line printer paper, asking, “Did you ever imagine floating point format out of the 1401?” Mike Albaugh replies, “I'm not only imagining it, I did it.” The observer notes that the output numbers are not in IEEE format, to which Mike quips that the IEEE floating-point standard did not even exist when the 1401 was designed.

---

[11:34](https://www.youtube.com/watch?v=uFQ3sajIdaM&t=694s) Recreating the FORTRAN Compiler Tape via Custom Tape Emulator

Getting the compiler to run required solving a major prerequisite: reconstructing a physical magnetic tape reel carrying the IBM 1401 FORTRAN compiler. Marc steps behind the tape drive bay to show the custom setup that made this possible. Connected to the back of the vintage hardware via an authentic IBM cabling interface is a modern flat ribbon cable routed into a specialized black box designed and built by the museum’s restoration engineers.

```mermaid flowchart LR accTitle: Tape Generation Pipeline accDescr: Pipeline showing data movement from modern PC controller through hardware emulator to the IBM 1401 and physical tape drive.

subgraph Modern_Control ["Emulation Host"] PC["Host PC Controller Interface"] BOX["Custom Hardware Tape Emulator\n(Simulates up to 6 IBM 729 Drives)"] PC --> BOX end

subgraph Vintage_Mainframe ["IBM 1401 System"] I1401["IBM 1401 CPU\n(Executes Tape Copy Routine)"] BOX -->|"Emulated Drive 1 & 2"| I1401 end

subgraph Real_Peripherals ["Physical Output Units"] TAPE3["Physical IBM 729 Tape Drive\n(Assigned as Tape 3)"] P1403["IBM 1403 Line Printer\n(Logs Records Written)"] I1401 -->|"Writes Magnetic Records"| TAPE3 I1401 -->|"Prints Record Listing"| P1403 end ```

This emulator hardware transparently mimics up to six authentic IBM 729 magnetic tape drives to the 1401 CPU. On a connected control laptop, the restorers mount digital tape image files: - **Drive 1**: Holds a self-executing utility program designed to read an emulated image and write it to an attached drive. - **Drive 2**: Holds raw data records extracted from the historical digital archive of the FORTRAN compiler tape. - **Drive 3**: Assigned to a real, physical vacuum-column IBM 729 tape drive loaded with a blank reel.

To prepare the physical tape, Marc winds the magnetic ribbon past the physical Beginning of Tape (BOT) reflective tab so the drive can sense the marker when executing a Load Rewind cycle. Once both the virtual drives and the physical drive are set to ready status, the 1401 begins execution. As the emulator feeds blocks across the virtual interface (tallying past record 1093, 1122, and onward), the 1401 writes them out to Drive 3, while simultaneously logging a full duplicate trace of every record onto the 1403 printer.

- Emulator capabilities: Emulates up to six IBM vacuum-column tape units simultaneously. - Configuration: Drive 1 runs the merge/copy program; Drive 2 serves the raw FORTRAN image; Drive 3 is the physical tape unit receiving data. - Tape positioning: Manual advance past the BOT reflective marker ensures clean rewind seeking to load point.

---

[16:13](https://www.youtube.com/watch?v=uFQ3sajIdaM&t=973s) Punching and Verifying the FORTRAN Source Deck

Reconstructing the magnetic tape compiler was only half the preparation; the team also needed the physical punched card deck for the FORTRAN source program. Unwilling to punch hundreds of lines manually on a standalone keypunch, they automated the process using an emulated tape image containing the source statements coupled to a small self-executing punch routine.

At the IBM 1402 Card Read-Punch, Marc highlights the physical mechanics of the dual-purpose peripheral. The machine features two distinct operational ends: - The **Reader** feed hopper, where cards must be placed face-down with the **9-edge** leading. - The **Punch** feed hopper, where blank card stock is loaded face-down with the **12-edge** leading.

This differing mechanical orientation ensures that when cards from both paths feed into shared intermediate stacker pockets, all cards finish oriented in the exact same direction.

Blank cards are placed into the punch side, and the 1401 rapidly cycles through the emulated card-punch tape program, perforating a fresh deck of source cards. While the IBM 1402 punches holes at high speed, it lacks an internal interpreter mechanism to ink the human-readable text along the top margin.

To inspect their newly created deck and confirm that the contents match the manual, Mike takes the unprinted cards over to a standalone IBM 026 Keypunch equipped with an interpretive printing feature. By feeding the cards through the 026 in duplicate mode, the machine reads the punched holes and prints the corresponding text along the top edge of a fresh card: - The first card reproduces compiler option flags: `PARAM I 990 0515` (specifying precision and allocation settings). - The subsequent cards reveal program comments denoting the matrix arithmetic routine. - The next cards produce actual executable statements, starting with matrix array declarations: `DIMENSION A(7,7), VECTOR(7), B(7,7)`. - The final card in the stack verifies the routine termination with an explicit `END` statement.

With the compiler tape written and the source card deck punched, validated, and human-readable, the entire toolchain is primed to run historical FORTRAN code directly on early 1960s commercial hardware.

[20:22](https://www.youtube.com/watch?v=uFQ3sajIdaM&t=1222s) Prepping the Card Deck and Restoring Historical Authenticity

The source deck for the demonstration is assembled in standard punch card fashion: a leading parameter card sets up the run, followed line by line by the FORTRAN statements, and capped off with an `END` card. With the source code physically stacked in the card reader, the team prepares the magnetic tape drives for an authentic, period-accurate compilation. Marc confirms that unit one is designated as Tape 1, which holds their freshly generated FORTRAN compiler tape, and initiates a rewind on the physical transport.

To ensure the run relies entirely on genuine vintage hardware rather than modern bridge equipment, Marc unplugs and unloads the modern tape emulator that had previously interfaced with the system. He relishes returning the system to pure vintage operation, declaring: “So now we're back into a historically correct state.” With a solid mechanical clonk, the emulator is detached and stowed away, clearing out what Marc jokingly dismisses as modern, ugly gear so the mainframe can execute the compilation using only its original core logic and tape units.

```mermaid flowchart TD accTitle: FORTRAN Compilation and Execution Workflow accDescr: Pipeline from punched card deck through 63 compiler passes on magnetic tape to final matrix calculation and printed output.

subgraph Input ["Input Setup"] A["Punched Card Deck<br>(Parameter + FORTRAN + END)"] B["Compiler Tape (Tape 1)"] end

subgraph Compile ["1401 Multi-Pass Compilation"] C["IBM 1402 Card Reader"] --> D["IBM 1401 CPU"] B <-->|"63 Overlay Passes"| D A --> C end

subgraph Exec ["Execution & Output"] D --> E["Invert Hilbert Matrix"] E --> F["Multiply Matrix x Inverse"] F --> G["Print Identity Matrix (IBM 1403)"] end ```

[21:39](https://www.youtube.com/watch?v=uFQ3sajIdaM&t=1299s) Running the 63-Pass Compiler and Inverting the Hilbert Matrix

After confirming that the IBM 1403 chain printer is online and ready, Marc triggers the compilation process. The 1401 pauses briefly, waiting on the IBM 1402 card-read-punch unit before feeding the cards through with rhythmic mechanical clicks. Once the final card clears the reader throat, the central processor dives into the massive multi-pass compilation task. Because the IBM 1401 has only 16K of core memory and lacks native floating-point hardware, the FORTRAN II compiler relies on an intricate series of tape-based overlays, stepping through 63 distinct passes as the magnetic tape drive shuffles back and forth reading successive compiler phases.

As soon as the 63rd pass finishes, the tape drive automatically rewinds to the beginning, signaling that compilation has completed cleanly. Marc hits the start key on the console to initiate the compiled binary. The machine begins grinding through the floating-point arithmetic of the scientific benchmark, and Marc sums up the completed run: “And that was the end of the FORTRAN scientific demo.” The printer outputs the final calculations, successfully demonstrating that the business-oriented mainframe could tackle heavy scientific computations.

- The scientific demo generates an ill-conditioned Hilbert matrix, inverts it, and multiplies the inverted matrix by the original. - The resulting printed product yields an identity matrix—bearing ones along the diagonal and zeros elsewhere, within floating-point precision limits—before computing a second matrix inversion.

## Notable quotes > [06:14](https://www.youtube.com/watch?v=uFQ3sajIdaM&t=374s) Fortran is really a stretch for the 1401. I mean, it's totally amazing that they were able to put it in there. — Marc

## Mentioned Computer History Museum, CuriousMarc, FORTRAN, FORTRAN II, IBM, IBM 026 Keypunch, IBM 1401, IBM 1402 Card Read-Punch, IBM 1403 Line Printer, IBM 729 Tape Drive, IEEE floating-point standard, Mike Albaugh

## Video description We attempt to compile and run a simple FORTRAN program on our vintage 1959 IBM mainframe computer at the Computer History Museum. FORTRAN is a big stretch for this business oriented machine, with 16k memory and a CPU not meant at all for scientific applications. Even integer multiply and divide instructions are an optional feature on the base machine! Success not guaranteed.

Come see the IBM 1401 computer at the Computer History Museum in Mountain View, California, USA: https://computerhistory.org/exhibits/ibm1401/

Simulation and programming environment available here: https://github.com/lucaseverini/ROPE.

Mike Albaugh has made a page that explains how to run the same demonstration in the SIMH simulation: http://nulli.us/f1401/package.html

Some pointers on how to start programming the IBM 1401 on my website (work in progress): https://www.curiousmarc.com/computing/ibm-1401-mainframe/ibm-1401-programming

Details on this implementation of FORTRAN: http://ibm-1401.info/1401-IBM-Systems-Journal-FORTRAN.html IBM 1401 FORTRAN compiler source code: http://ibm-1401.info/1401-FORTRAN-Illustrated.html E-mail exchanges with the original developers of the IBM 1401 FORTRAN: http://ibm-1401.info/FORTRAN-e-mails.html

Official CHM IBM 1401 Video: https://youtu.be/ZPpV8X91neQ

More CuriousMarc IBM 1401 videos: https://www.youtube.com/watch?v=7Lh4CMz_Z6M&list=PL-_93BVApb59MH7pDttB_aUnP0w3sB6B1

Our sponsor for PCBs: https://www.pcbway.com Support the team on Patreon: https://www.patreon.com/curiousmarc Merch on Teespring: https://teespring.com/stores/curiousmarcs-store Learn more on companion site: https://www.curiousmarc.com Contact info: https://www.youtube.com/curiousmarc/about

[Source](https://www.youtube.com/watch?v=uFQ3sajIdaM)

中文简报

修复后的1959年产IBM 1401通过磁带版FORTRAN完成希尔伯特矩阵求逆 借助软件子例程和多达63次遍布的磁带覆盖区架构,面向商业的IBM 1401在缺乏原生数学硬件的情况下成功执行了科学浮点计算。 CuriousMarc与修复专家Mike Albaugh演示了在计算机历史博物馆的IBM 1401大型机上运行FORTRAN II代码所需的各个步骤。为准备此次运行,团队利用定制硬件磁带仿真器制作了一盘可用的实体编译器磁带,并通过IBM 1402和IBM 026穿孔机从仿真磁带镜像中穿孔制成符合当时历史的原版源码卡片组。在排除了由校验位缺失引发的初始奇偶校验和存储错误后,团队断开了所有现代设备,以实现完全符合历史真实的配置。1401从磁带上顺利完成了全部63次编译器覆盖段调用,并成功运行了一项对病态希尔伯特矩阵进行求逆与相乘的科学基准测试,最终在IBM 1403行式打印机上打印出了浮点结果。 计算机历史博物馆的修复人员在一台原装1959年产IBM 1401十进制大型机上,成功编译并运行了FORTRAN II科学基准测试。 (0:10) 由于IBM 1401的16K磁芯内存无法容纳完整的FORTRAN编译器,该系统依赖于从磁带流式读取的精密63遍覆盖区架构。 (21:39) 该基准测试利用软件合成的15位浮点运算,成功对一个病态希尔伯特矩阵进行了求逆并计算出单位矩阵。 (6:14) 为了在运行时不依赖现代辅助设备以还原历史原貌,团队在拔掉设备前,使用基于FPGA的定制磁带仿真器将历史磁带镜像写入了实体磁带卷。 (11:34)

Source quotes

[6:14] Marc: Fortran is really a stretch for the 1401. I mean, it's totally amazing that they were able to put it in there.

Original transcript

[0:10] Hello folks, welcome back to our IBM 1401 exhibit. [0:15] Our dinosaur computer from the 1960s. [0:24] This is Mike Albaugh, and we are with our [0:28] 1401 exhibit, here using the machine we call the Connecticut, and we're going to attempt to [0:35] compile a Fortran program? [0:36] Right. And this is the first example in the manual, and [0:41] we figured that was as good as any point to start. [0:44] Alright. [0:48] OK let me take it from another angle here, so we see the cards. [0:53] I'm missing a card, wait. [1:16] Oh! We need to load the tape. [1:23] And we have been laboring for... [1:26] A month? [1:27] (Laughter) [1:29] A few hours a day. [1:30] A few hours a day. [1:32] The tough part was to remake the tape of the Fortran, but we think we have made a good one [1:38] We don't know. We can hope. [2:02] So, we're afraid the beginning of tape marker fell off the tape, or we didn't see it. [2:08] In which case the tape will rewind and [2:12] go off the reel. [2:15] There you go! [2:16] Oh! [2:16] It was in there. [2:17] All ready. Cool! [2:28] Right. [2:30] Wow! It read... it read a few records, [2:33] and then I saw the tape move, not the reel but the tape. [2:36] It got a reader check. [2:39] Oh! That's good news. [2:42] It means it wants to read something. [2:51] And, it's not reading the other cards. [2:56] It's not reading them. [3:03] It wanted to print something, that's why it stopped. [3:10] Oh yeah! [3:12] That's working. That's chooching over there. [3:19] It compiled? [3:22] That's the listing. It lists as it reads it into memory. [3:28] It read it. Well that's as far as we have even gotten, eh? [3:30] So what's the next step? [3:34] The usual last card restart. Ah, OK. I should have put a blank after that. [3:42] Wow! And? [3:46] Lots of red. [3:51] Oh, whoa, we have a whole bunch of red lights here. [3:54] Yeah. [3:57] Houston, we have a process error, a reader error, a storage error. [4:05] And a B and an A register parity problem. [4:11] Well this is as far as I've ever gotten, Michael. This is pretty amazing! [4:23] And this is the instruction it was trying to run, [4:28] and it got a - it's a three? [4:31] It's an "L". Oh. [4:34] It was doing a load, [4:39] which could be a tape read. [4:41] What the heck is that? But - yeah. [4:49] We have the little character cheat sheet on that one. [4:54] What is "B, A, 8, 2, 1?" [4:58] So the character we have down here is a "B, A, 8, 2, 1", [5:04] Which is a dot, [5:06] which Michael, who speaks fluently 1401 assembly, says [5:11] it's a Halt [5:14] We have "B, A, 8, 2, 1", [5:19] So why do we have a parity error? It should have this bit on. [5:24] It should, well, anything in memory should be an odd parity. [5:27] And then we have - so this bit, [5:29] which is parity bit, should be on, and it's not, and then it went "ugh" [5:33] that's not a good number, and we've got the process error, and the storage error. [5:39] Everything went haywire. [5:43] We can do the time-honored thing that customer support always tells you to do: try it again! [6:00] It's a op code 1 which means read, but... [6:03] Here we go [6:05] There we go. [6:09] OK. How come it didn't read the tape program? Oh, it did! [6:14] We've a reader check for the last card [6:25] Oh, hey, it's compiling! [6:28] It is compiling. [6:47] It's doing something. [6:59] All right. Reader, stop. [7:03] It stopped. Finished. [7:09] I think, if I press start, it will run. [7:13] Yeah, it finished compiling, went to a halt. [7:23] It's doing something. [7:25] *Printer noises* [7:27] It did it. [7:30] You got it! [7:34] Printing numbers. [7:36] What is it supposed to do by the way? [7:38] I forget at this point. It's been a couple of months since I typed that in. [7:45] It's in deep trance here... It's calculating hard. [8:09] It's a very very slow machine at doing scientific calculations. [8:13] So Fortran is really a stretch for the 1401 [8:18] I mean, it's totally amazing that they were able to put it in there. [8:22] *Printing noises* [8:27] It's calculating a table of something. [8:38] And it just halted. [8:44] Michael I think you did it. Successful compilation and running. Why don't we look at the output? [8:49] Oh, I don't know, but OK, sure. [8:57] Start of FORTRAN compilation. [8:59] Okay. [9:01] That's the one we got, that's fine, with the parameters. [9:04] Machine size specified is [9:06] 8,000 meaning characters of storage. [9:09] Actual machine size is 16,000. So we are maxed out at sixteen thousand characters [9:15] Yes! We've the biggest meanest machine around. [9:18] And that's the listing of the program. [9:22] And you still don't remember what it does? [9:24] It says matrix arithmetic. Alright. [9:28] Okay, and then the result of the compilation it says, I believe, [9:35] 800 input characters, so the whole program. [9:40] Modulus is 5, that's the size of integer variables, mantissa is 15, the size of the mantissa of a floating point variable. [9:49] Then where the variables are stored in memory [9:52] Assignments, blah blah [9:55] And then that's the end of compilation [9:58] Press start to go! [10:00] Oh wow, there's a user interface in this thing. Oh, it's a Hilbert matrix. It takes the matrix, [10:06] does inverse, [10:08] multiplies it, and inverts it a second time. [10:11] Oh-ho! [10:14] Pretty cool. [10:16] And - It takes a little longer than your iPhone would if your iPhone had FORTRAN. [10:20] Oh, it does? Yeah. [10:23] Wow! [10:24] That's it! [10:25] Congratulations! [10:27] I didn't think it would go that far. That's pretty cool. [10:37] What program did you get? [10:38] Did you compile something? [10:39] Yeah. Here is the listing. [10:41] You're kidding me? [10:42] No! [10:43] My goodness! [10:45] These are examples one and two from the manual [10:48] the first comments on page whatever of C24 dash whatever [10:55] So, how many decades did it take to run? [10:58] No, it was pretty quick actually. [11:00] Not bad considering a 90 kilohertz machine. [11:04] Oh my God! I can't believe this. [11:06] Look at this. [11:08] Floating point numbers. Floating point! [11:10] Did you ever imagine floating point format out of the 1401? [11:13] I'm not only imagining it, I did it. [11:18] It wasn't an IEEE format, wasn't it? [11:19] Actually IEEE format didn't exist then! [11:22] Alright. [11:24] So how did you get the big records? [11:27] Well, that's complicated. [11:34] So one of the most difficult steps we had [11:38] to go through to revive the Fortran compiler was to create a tape of it. [11:46] And in order to understand how we did that, I have to [11:49] show you a little trick that we use. [11:52] So if you go to the back of our tapes here, [11:56] you will see that, [11:59] one of the connectors - this is a regular one - [12:03] but this one, [12:04] looks like it has a suspiciously modern cable attached to it. [12:10] And it goes to a black box here, and this is our tape emulator. Let me show you from the other side. [12:20] So here - pay no attention to that evil computer. It just allows us [12:26] to send commands to the tape emulator. So this guy [12:31] is the other side of the box. I can open it up. [12:38] And... [12:40] You have serious hardware in it. [12:43] Designed by a few of the restorers. And so, this hardware pretends to be [12:51] six vintage tapes to the 1401, and you can see the interface here on the computer. [12:57] Right now I have three open, and you can do as you would expect [13:04] in a real tape, right. You can load it, [13:08] you can change density, [13:11] you can start it and basically, what that reproduces is the same [13:17] array of buttons that we have over here, on a real tape. [13:33] To give you an idea of what's in the file [13:37] that's the executable mounted on tape one. [13:41] Merge program over here. Upload - Rewind. [13:50] Start. [13:53] This is the data [13:58] So this is the original tape formatted in a way that [14:06] the tape emulator understands it. [14:08] Load - rewind, [14:11] start. [14:11] All right, both at 0. [14:15] So, we're trying to recreate a new FORTRAN tape. [14:17] A real tape from an emulated tape [14:21] Step one is to put it in. [14:27] And you have to wind it past the Beginning Of Tape marker. [14:35] If I can - there it is [14:36] This guy, that's the Beginning Of Tape. [14:40] If I'm past that [14:44] it will rewind and find the load point when it gets on the reflective marker [14:51] All right, load rewind. [14:58] There you go. It's loaded. Start. [15:02] And then we make it tape number 3, so this is going to be a real tape number 3. [15:12] There we go! [15:14] So now it's working. [15:18] It's writing on our tape. [15:22] Printing it. [15:25] And then we should see it on the emulator advancing, [15:31] yes, at record 1093. [15:35] 1122. [15:36] So it's executing this program, [15:41] taking the data from this emulated tape, [15:47] writing it to this real tape, [15:51] and having a bowl printing what it's writing. [15:56] Which we didn't really want to happen, but you know... [16:00] Actually hat's not bad. So that's the FORTRAN tape. [16:04] This is a pretty darn complex program. [16:05] It's listing it as it's writing on the tape. Right. [16:13] So now that we have recreated the FORTRAN tape, we are not done because we need to recreate [16:19] the source deck, and we didn't feel like punching it by hand. [16:25] So here it is, the source. [16:28] And you can tell it's a [16:31] short FORTRAN program [16:35] with a little auto-punch program at the beginning of it. [16:38] So we'll get the 1401 to punch it for us, and that's the self-executing tape that will punch [16:45] the card deck. Upload file, load rewind, start. OK. [16:55] Back to the real machine here. Two ends to the 1402. That's the reading end, [17:05] and that's the punching end. [17:15] All right, so... [17:16] Now we're going to [17:18] punch a set of cards. Oh wait [17:21] 12 edge. Yeah, so it's [17:24] 12 edge on this side, and 9 edge on the other. [17:27] Yeah, because they're supposed to be able to mix in one pocket, they want to be both facing the same way. [17:34] So now we are going to do similar thing [17:40] is, load the emulated tape program and have the 1401 punch [17:45] a FORTRAN source card deck. Recreate, right. [17:49] We're punching! [17:52] So the blank cards go here. [17:54] Woops, it's already done. [17:55] And the fresh deck is over here. [17:58] These have holes in it? [17:59] It has holes in it. I'm checking whether the card says "end". [18:06] And it seems to. [18:08] So that's the end card of the FORTRAN source. [18:11] Okay. Yes, so the 1401 [18:14] punches real fast, but doesn't print what it has on top of it. [18:18] Let's go duplicate some cards to see [18:21] what's on it. [18:34] So the first card should be parameters? [18:37] Yeah, like the options for the compiler. [18:41] Right, so what Michael is going to do, he is going to duplicate the cards on the 026 and the 026 has a printer on it. [19:00] So it's going to reveal what it actually has. [19:03] And it says... [19:05] So yes, the first card here just shows the duplicate. [19:10] So now we can see what's on it. It says param [19:14] I 990 0515 [19:17] Can we get a FORTRAN statement? So basically it's one FORTRAN statement line per card. [19:36] Might be another comment. [19:38] It does look like another comment. [19:43] And it says... Matrix arithmetic. [19:47] We should be getting into actual code soon. [19:49] Probably a "dimensions" or something like that. Yeah, that's real code. [20:04] And yes, so that's declaring our arrays. [20:07] Finally, we have a FORTRAN statement here. [20:09] Dimension A 77 vector 7 B 7 7. [20:13] All right! Cool. [20:15] So the whole deck is like this and then the last one is an end card? [20:19] That's the end card. So, [20:22] one parameter card, then the whole Fortran thing line by line, and then an end card, and that's the source code, that's your file. [20:37] Now we can go try to compile it. [20:42] Source code over there. [20:46] I have to make tape - this tape one, right? [20:49] Yeah [20:51] So this now [20:53] is the real thing, tape one, which I actually have to rewind. [21:02] Okay, so, [21:05] we rewind our compiler, our freshly made compiler. [21:10] I have to unhook [21:15] the emulated one. So now we're back into a historically correct state. [21:21] I don't need the emulator anymore. [21:25] Unload. [21:27] Clonk. [21:29] Gone. So this guy, all that modern, ugly stuff, that's not counting anymore. [21:33] We are going to do the real thing. [21:36] All right! [21:39] Do we have the printer ready? [21:45] It's all good. [21:47] All right. Com-pile. [21:51] Is it waiting for the reader? [21:53] Yeah, it's waiting for the reader. [22:01] Reading the cards. [22:05] You get the last couple cards. [22:07] Okay. [22:08] And now it's compiling. [22:12] Machine is working pretty hard. [22:18] And so it does it one pass at a time, and so it's reading the passes right here. [22:25] Sixty-three passes. [22:28] It just read another pass. [22:33] And it's rewinding, it's done! [22:36] Alright, so now we're going to run the program by pressing start. [22:43] And... It is calculating. [22:46] Here you go. [22:55] That's it! It did it. [23:00] So, [23:01] it took a Hilbert matrix, [23:04] inverted it, that took it a while, then it multiplied both and got [23:09] identity, it's all ones on the diagonal, mostly, zero otherwise. [23:14] Mostly. [23:16] And then it inverted it another time. [23:21] And that was the end of the FORTRAN scientific demo.