This program emulates on a PC most of the functionality of the Programma 101, a programmable desktop calculator marketed by Olivetti in the late '60's. The program runs on any PC (286 and up) with a VGA screen. The program together with its Turbo Pascal source code, is provided as a ZIP file.

The emulator uses the PC's standard arithmetic and 6-bytes real number representation. Though the P101's binary-coded decimal representation and fixed-point arithmetic are emulated by applying appropriate round-off (as determined by the decimal-indicator setting) to the intermediate results, it is not possible to obtain exactly the same answers (see for instance test program

up arrow | ^ |

down arrow | $ |

up-and-down arrow | & |

diamond | % |

star | ! |

multiplication | * |

division | : |

square root | # |

The various registers are M, R, A, A/, B, B/, C, C/, D, D/, E, E/, F, F/. Like in the Olivetti handbooks, we use in this text (not in the programs) x as shorthand for X/.

In the P101, a and A are in fact the left and right parts of a single register containing 22 decimal places which is normally used for storing two 11-decimal numbers (plus decimal points and signs). In the emulator however a and A are completely separate registers. The same is true for the B, C, D, E and F registers.

In the P101, F, E and D are used for storing 24 instructions each as soon as the dedicated (invisible) instruction store's capacity of 48 is exceeded. In the emulator, on the contrary, the instructions are stored in a separate (invisible) buffer which will never overflow into the F, E and D registers.

These differences will normally have no influence on the performance of existing programs, unless the programmers have been using 'foul tricks'.

+ (add) instruction phase_1 phase_2 rounded_result complete_result + A + M A R M + A + M A R R + R-->M A + M A R A + A-->M A + M A R a + a-->M A + M A R B + B-->M A + M A R b + b-->M A + M A R C + C-->M A + M A R c + c-->M A + M A R D + D-->M A + M A R d + d-->M A + M A R E + E-->M A + M A R e + e-->M A + M A R F + F-->M A + M A R f + f-->M A + M A R - (subtract) * (multiply) similarly as + : (divide) computes in phase_2 the quotient A/M = q. The result r (q rounded to n decimal places) is stored in A, and (q-r)*M is placed in R (without being rounded). Hence with n=0, R will contain A mod M. # (square root) A contains the rounded result, R remains undefined, M contains twice the result. & (abs) A & sets the sign of the number in A to +, M and R remaining unchanged.

X ^ copies the contents of M into X. X is A|a|B|b|C|c|D|d|E|e|F|f. X $ copies the contents of X into A. X is M|B|b|C|c|D|d|E|e|F|f. X & swaps the contents of X and A. X is M|B|b|C|c|D|d|E|e|F|f. /& copies the decimal part of A to M.

X/ clears X. X is B|b|C|c|D|d|E|e|F|f. X % prints X /% prints an empty line. S prompts the user (by >>) to enter either a number or a directive: q to quit the program or (in MAN101 only): ? help r toggle register display mode (default: display enabled) d choose decimal indicator position (default 4). R S swaps the contents of registers R and D.

- It is possible, for instance by specifying the wrong start address, to force the program into a loop which (in the present version) only can be broken by resetting the PC.
- In most error conditions the emulator will report what is going wrong. The original P101 used red and green lights as status indicators; also the
keyboard would be blocked at certain errors.

- Input data and results (printed on paper by the P101) are written to a textfile "results".

- PROG101 shows at every input and output operation first the number of the current instruction.

- PROG101 can be terminated by typing "q" (instead of a number) after the >> prompt.