====== APE(X)C (All Purpose Electronic X-Ray Computer) (1951?) ======
===== Features =====
//(from the source code)//
* 32-bit data word size (10-bit addresses): uses fixed-point, 2's complement arithmetic
* CPU has one accumulator (A) and one register (R), plus a Control Register (this is what we would call an "instruction register" nowadays). No Program Counter, each instruction contains the address of the next instruction (!).
* memory is composed of 256 (maximal value only found on the UCC - APE(X)C only has 32 tracks) circular magnetic tracks of 32 words: only 32 tracks can be accessed at a time (the 16 first ones, plus 16 others chosen by the programmer), and the rotation rate is 3750rpm (62.5 rotations per second).
* two I/O units: tape reader and tape puncher. A teletyper was designed to read specially-encoded punched tapes and print decoded text.
* machine code has 15 instructions (!), including add, substract, shift, multiply (!), test and branch, input and punch. A so-called vector mode allow to repeat the same operation 32 times with 32 successive memory locations. Note the lack of bitwise and/or/xor (!) .
* 1 kIPS, although memory access times make this figure fairly theorical (drum rotation time: 16ms, which would allow about 60IPS when no optimization is made)
* there is no indirect addressing whatever, although dynamic modification of opcodes (!) allows to simulate it...
* a control panel allows operation and debugging of the machine.
===== Usage =====
You should specify a cylinder image with code to run in it. Arguably, APEXC does not require such an image, since you may enter code in the control panel, but this would be a pain in the ass.
If the program you run use punched tape I/O, you may specify tape image files. The first unit is read-only, the second unit is write-only.
In MESS, you can use "cylinder" (cyln) device to load a cylinder image and the "punchtape1" (ptap1) and "punchtape2" (ptap2) devices to choose which punchtape you want for input and output. The resulting MESS command line may look like this
mess apexc -cyln ram_image.apc -ptap1 input.tap -ptap2 output.tap
**Important:** Note that, when you quit MESS or the APEXC driver, the contents of the cylinder are saved to the image you specified. This simulates the behavior of the APEXC, where the cylinder image IS the working memory. If you don't like this behavior, you may either write-protect the cylinder image file, or keep a backup copy elsewhere on your hard disk (highly recommended).
Note that the APEXC CPU is stopped on start-up, so that you may check the machine state and enter the start-up program address.
On start-up, the instruction at address 0 is loaded into the Control Register, then the machine is stopped. To run the program starting at address 0, just press the Run/stop switch (the Run/stop switch is mapped to the "Return" key on the main keyboard).
To start a program at another address, you need to load the first instruction into the Control register with the control panel. To do so, use keys "1" through "0" on the main keyboard to enter the 10-bit address into the 10 most significant bits of the Control Panel display, and set other bits to 0 with the three rows of keys under "1" through "0" (each key toggles a bit in the control panel display; don't be intimidated if it sounds complicated, it should eventually appear straight-forward when you try, provided you know what binary scale is). You have thus generated a Stop instruction pointing to the first instruction of the program. Write this instruction into the Control Register, by holding "Left Shift" pressed and pressing "1" on the numeric keypad. You should now press the Run/stop switch twice (mapped to the "Return" key on the main keyboard). First press executes the stop order, but fetches the first instruction of the program into the control register. Second press starts running the program, start
ing with the first instruction.
== Control panel usage ==
This is relatively simple. The Control Panel may hold and display a 32-bit value. Display is made of 32 lamps, which show the current value in binary scale (each lamp represents one bit). Hence, the normal usage is loading the value you want to edit into the control panel, editing it, then saving it to the proper location.
== Default key map ==
* Run/stop switch: "Return" key on main keypad
The next 6 keys may be used alone to read the register into the control panel display, or in combination with the Left Shift key to write the value in the control panel display into the register.
* Read/Write Control Register: "1" key on numeric keypad
* Read/Write Accumulator: "2" key on numeric keypad
* Read/Write Register: "3" key on numeric keypad
* Read/Write Current Head Block (never used on APEXC - used for bank switching): "4" key on numeric keypad
* Read/Write Memory Location: "5" key on numeric keypad
* Read/Write Memory Location pointed to by ML register: "6" key on numeric keypad
To write instead of reading: "Left Shift" key (when you press one of the 6 keys above, the designated register is read into the control panel display, unless this key is being pressed, in which case the value in the control panel display is written into the register)
* Toggle bits 1 through 10 in display: keys "1" through "0" on the main keyboard
* Toggle bits 11 through 20 in display: key row directly below the former on the main keyboard ("Q" through "P" if your keyboard is QWERTY)
* Toggle bits 21 through 30 in display: key row directly below the former on the main keyboard ("A" through ";" if your keyboard is QWERTY)
* Toggle bits 31 and 32 in display: key row directly below the former on the main keyboard ("W" and "X" keys if your keyboard is QWERTY)
===== Known Issues =====
Since I have no description of the control panel of an actual APEXC, I implemented a common-place control panel, so this part of the emulation is not accurate. I don't even know how an actual APEXC was operated, and the procedures I describe above are not accurate, either.
The driver should work correctly as of MESS .37b15. Still, it needs development tools, sample code and usage instructions desperately. I have tons of sample code (which was the reason for starting to write this driver), but still need to retype it. I have started work on an assembler, too.
===== History and Trivia =====
The APEXC was designed by Andrew D. Booth at Birkbeck College, London, in the early 50's. From 1943 on, he started working on the determination of crystal structures using X-ray diffraction data. The computations involved were extremely tedious and there was ample incentive for automating the process. In 1947, along with his collaborator and future spouse Kathleen Britten, he spent a few months with von Neumann's team, which was the leading edge in computer research at the time. Booth designed an electromechanical computer, the ARC, in the late 40's. Later on, they built an experimental electronic computer named 'SEC' (Simple Electronic Computer), and finally the APEC (All-Purpose Electronic Computer) series.
== APEC series machines ==
According to a 1956 document, the APEC series included the following machines:
* APE(X)C: Birkbeck College, London (before 1955)
* APE(N)C: Board of Mathematical Machines, Oslo ('N' must stand for 'Norway')
* APE(H)C: British Tabulating Machine Company (No idea what 'H' can stand for)
* APE(R)C: British Rayon Research Association ('R' must stand for 'Rayon')
* UCC: University College, London (circa January 1956)
* MAC (Magnetic Automatic Calculator): "built by Wharf Engineering Laboratories" (February 1955)
* The HEC (Hollerith Electronic Computer - silly name invented by BTM directors), built by the British Tabulating Machine Company [later to become International Computers and Tabulators (ICT), then International Computers Limited (ICL)], a commercial machine sold in several models (I have heard of HEC 1, HEC 2, HEC 2M [no idea what the difference with HEC 2 is] and HEC 4) (before 1955)
Only one of each of these machines was built, with the exception of HEC (and possibly MAC) which were commercial machines produced in small series. They were similar in design, with various small differences, mostly in I/O equipment (either punched-card machines - APEXC, APEHC - or teletypers (keyboard and printer, and paper tape reader and puncher) - APERC, APENC). Also, the UCC had 8k words of storage, instead of 1k word for other machines, and the MAC used germanium diodes in replacement of many tubes. The HEC used standard
Hollerith punch cards; the HEC 4 had a printer, too, and it featured several instructions (divide) and registers not found on the APEXC.
I am sorry I know little more about Booth, his team, and the history of these machines.
== Technical Description ==
The APEXC is an incredibly simple machine.
Instruction and Data words are always 32-bit-long. The processor uses integer arithmetic with 2's complement representation. Addresses are 10-bit-long. The APEXC has no RAM, except a 32-bit accumulator and a 32-bit data register (used along with the 32-bit accumulator to implement 64-bit shift instructions and hold the 64-bit result of a multiplication). Instructions and data are stored in two magnetic drums, for a total of 32 circular magnetic tracks of 32 words. Since the rotation rate is 3750rpm (62.5 rotations per second), the program execution speed can go from as high as the theoretical maximum of 1 kIPS to lower than 100IPS if program instructions and data are not contiguous. Nowadays, many a pocket calculator is faster.
One oddity is that there is no program counter: each machine instruction includes the address of the next instruction. This design may sound weird, but it is the only way to achieve optimal performance with this cylinder-based memory.
The machine code is made of 15 instructions only, namely addition, subtraction, multiplication, load (3 variants), store (2 variants), conditional branch, right arithmetic bit shift, right bit rotation, punched-card input, punched-card output, machine stop, and bank-switching (which is never used on the APEXC, since it only has 1024 words of storage, and addresses are 10-bit-long). A so-called vector mode enables to repeat the same operation 32 times with 32 successive memory locations. Note the lack of bitwise and/or/xor and division. Also, note the lack of indirect addressing modes: dynamic modification of opcodes is the only way one may simulate it.
Another oddity is that the memory bus and the ALU are 1-bit-wide. There is a 64kHz bit-clock and a 2kHz word-clock, and each word memory and arithmetic operation is decomposed into 32 1-bit memory and arithmetic operations: this takes 32 bit cycles, for a total of 1 word cycle.
The processor is fairly efficient: most instructions take only 2 word cycles (1 for fetch, 1 for read operand and execute), with the exception of stores, shifts and multiplications. Yes, the APEXC CPU is a RISC: there is no other adequate word.
Note there is no ROM, and therefore no 'bootstrap loader' or default start-up program whatever. As far as I know, no executive or operating system was ever written for the APEXC, although there were subroutine libraries of sorts for common arithmetic, I/O and debug tasks.
Operation of the machine is normally done through a control panel which allows the user to start, stop and resume the CPU, and to alter registers and memory when the CPU is stopped. When starting the machine, the address of the first instruction of the program to be executed must be entered in the control panel, then the run switch must be pressed. Most programs end with a stop instruction, which enables to check the state of the machine, possibly run some post-mortem debugging procedures (a core dump routine is described in an APEXC programming book), then enter the address of another program and run it.
Two I/O devices were supported: a paper tape reader, and a paper tape puncher. The puncher output could be fed to a printer ('teletyper') unit when desirable. Printer output is emulated and is displayed on screen. Tape input was either computer-generated by the APEXC, or hand-typed with a special 32-key keyboard (each tape row had 5 data holes (<-> bits), which makes 32 different values).
Generated on Sun Jul 19 10:17:28 2009