The world's first programme stored and run on a computer

0001:00011000000000100000000000000000
0002:01011000000001100000000000000000
0003:01011000000000100000000000000000
0004:11011000000001100000000000000000
0005:11101000000000100000000000000000
0006:11011000000000010000000000000000
0007:00000000000000110000000000000000
0008:00101000000001000000000000000000
0009:01011000000000010000000000000000
0010:10011000000001100000000000000000
0011:10011000000000100000000000000000
0012:00000000000000110000000000000000
0013:00000000000001110000000000000000
0014:01011000000000100000000000000000
0015:10101000000000010000000000000000
0016:11011000000001100000000000000000
0017:11011000000000100000000000000000
0018:01011000000001100000000000000000
0019:01101000000000000000000000000000
0020:10111111111111111111111111111111
0021:10000000000000000000000000000000
0022:00100000000000000000000000000000
0023:00000000000000000011111111111111
0024:11111111111111111100000000000000

The first programme to be stored in a computer was written by Tom Kilburn, and run for the first time on the 21st June 1948, on Manchester Mark 1, the world's first stored-program computer. It was a program to find the highest proper factor of 2^18, this was to be done by trying in a single routine every integer from (2^18-1) downward, the necessary divisions were done not by long division but by repeated subtraction of the divisor (because the Mark 1 only had a hardware subtractor). About 130,000 numbers were tested, this involved 3.5 million operations. The correct answer was obtained in a 52-minute run. The program was encoded in only 17 instructions

The original program has been lost. The revised version (below) is from G.C. Tootills notebook, a contemporary of Kilburn. This uses two extra instructions to copy the trial factor because the original version overwrote it with the final answer, resulting in the need for it to be keyed in again before the program could be rerun. In this version C is used to represent the computer (ie accumulator), Cl to represent control register, the other letters a,b,r are respectively the number for factorizing, a trial factor and a remainder.

 

Picture : Kilburn highest factor routine (amended)


~ o ~


A Simulator of Mark 1 including binary code of the first programme is available.