![background image](http://html1.mh-extra.com/html/olivetti/programma-101/programma-101_reference-manual_3789955044.webp)
Programming Techniques
Following are some frequently encountered mathematical statements and suggested
Programma solutions, assuming the value a is in the A register:
(a + 1)
(a - 1)
(1 - a)
a(1 + a)
a(a - 1)
a(1 - a)
A
÷÷÷÷
+
A
÷÷÷÷
-
A
÷÷÷÷
-
A x
+
A x
-
A x
-
Divide a by itself creating 1 in the A register.
Add a to 1 giving ( a + 1)
Divide a by itself creating 1 in the A register.
Exchange the contents of M (a) and the contents of A (1).
Subtract 1 from a giving (a - 1).
Divide a by itself creating 1 in the A register.
Subtract a from 1 giving (1 - a).
Multiply a by itself giving a
2
in the A register.
Add a (from M) to a
2
giving (a
2
+ a) which is equal to a(1 + a)
Multiple a by itself giving a
2
.
Subtract a from a
2
giving (a
2
- a) which is equal to a(a - 1)
Multiply a by itself giving a
2
.
Exchange the contents of M (a) with the contents of A (a
2
).
Subtract a
2
from a giving (a - a
2
) which is equal to a(1 - a).
- 44 -