The status bits
Part of the Control and Timing chip, the status register contains 12 bits which are used as logical flags to keep track of past events in the state of the machine during run time. Each bit can be set (1), reset (0) or interrogated. In my explanations Sx, means “status bit x”, x being from 0 to 12 (0 to b, in hexadecimal value as shown in the simulator traces).
1) One of these 12 bits (S0) is hardwired: when a key is pressed
(key down) the status bit 0 (S0) and is set to 1, by the keyboard logic.
2) S1, S2, S5, S9, S10 are used as switches between math functions: here is the complete table.
|
S1 |
S2 |
S5 |
S9 |
S10 |
ln |
0 |
1 |
0 |
1 |
0 |
log |
0 |
1 |
1 |
0 |
0 |
ex |
0 |
1 |
0 |
1 |
0 |
xy |
0 |
1 |
0 |
0 |
0 |
tan |
1 |
0 |
0 |
0 |
0 |
arc tan |
1 |
0 |
0 |
0 |
1 |
cos |
0 |
0 |
1 |
1 |
0 |
arc cos |
0 |
|
1 |
1 |
1 |
sin |
1 |
0 |
1 |
0 |
0 |
arc sin |
1 |
0 |
1 |
0 |
1 |
3) S3 = 1 when CHS key has been pressed
4) S4=1 means that the "EEX" key has been pressed. This flag is used with S11:
- if “EEX” is pressed first, entering for example "EEX 2", then S4=1 and S11=0,
- Otherwise for example "1.23 EEX 2", S4=1 and S11=1.
5) S5= The flag S5 as multiple context dependant role:
- in the “disp” loop it means that the error blinking display is requested,
- in the “log” routine it switches between ln and log (base 10),
- in the cordic trigo routine it switches between tan (arc tan) and others (sin, cos ..).
6) S6=1 means "." (decimal point) has been pressed.
7) S7=1 means that the stack must be pushed (a push is requested) : E -> F, D -> F, C -> D.
8) S8=1 means in the “disp” routine that the key presently down has not yet been processed. Locally this flag is used to switch to the ex (set to 0 at 002, tested at 2011 and set to 1 at the end of dsp address 307- so in the case of the ln function nothing has to be done).
9) S10 is set to 1 by the “prefix” key “ARC”.
10) S11 means that a number has been entered with a mantissa (see above).
11) Global reset
All the status bits are reset globally by each of the 2 "clear status" instruction:
- at address 0136, entering “of13” routine: that is to say on every return of math routine, and when CLR and Clx keys are pressed?
- at address 077, when key “ENTER” is pressed.
In this table, I give the ROM address where a status bit is set or reset
individually, and globally (“clear status”), the routine where the action is
taken and the article where it is commented.
Address |
Label |
Instruction |
routine |
article |
|
|
|
|
|
|
|
16 |
00002: |
l00002: |
0 -> s8 |
exp entry point |
Key code tokens |
243 |
00304: |
l00304: |
0 -> s8 |
dsp7 |
Display and wait |
255 |
00317: |
dsp8: |
0 -> s0 |
dsp8 |
Display and wait |
263 |
00327: |
|
0 -> s5 |
end of dsp (reset prefix) |
Display and wait |
299 |
00367: |
dsp1: |
0 -> s10 |
start of dsp |
Display and wait |
425 |
01154: |
l01154: |
0 -> s1 |
trigo (other than Tan and Sin) to return via rtn12 |
Trigonometry |
790 |
02271: |
lnc2: |
0 -> s8 |
ln requested |
Logarithms |
|
|
|
|
|
|
19 |
00004: |
l00004: |
1 -> s5 |
entry point |
Key code tokens |
20 |
00005: |
l00005: |
1 -> s9 |
entry point |
Key code tokens |
21 |
00006: |
|
1 -> s2 |
entry point |
Key code tokens |
67 |
00047: |
l00047: |
1 -> s5 |
entry point |
Key code tokens |
68 |
00050: |
|
1 -> s1 |
entry point |
Key code tokens |
71 |
00052: |
l00052: |
1 -> s9 |
entry point |
Key code tokens |
74 |
00054: |
l00054: |
1 -> s10 |
entry point |
Key code tokens |
96 |
00074: |
|
1 -> s3 |
CHS pressed |
Digits entry |
118 |
00120: |
|
1 -> s11 |
number entry |
Digits entry |
193 |
00227: |
|
1 -> s6 |
decimal point entered |
Digits entry |
227 |
00267: |
fst5: |
1 -> s7 |
stack push requested |
The 4 level stack |
238 |
00300: |
|
1 -> s5 |
blinking display on error |
Misc. routine |
247 |
00307: |
dsp3: |
1 -> s8 |
disp 3 |
Display and wait |
269 |
00334: |
|
1 -> s7 |
output format |
Output format |
293 |
00362: |
eex2: |
1 -> s4 |
CHS routine |
Digits entry |
|
|
|
|
fst stack operation |
The 4 level stack |
121 |
00123: |
|
if s4 = 0 |
digit entry |
Digits entry |
145 |
00151: |
|
if s4 = 0 |
output format |
Output format |
160 |
00166: |
l00166: |
if s4 = 0 |
CHS routine |
Digits entry |
220 |
00260: |
|
if s3 = 0 |
stack operation |
The 4 level stack |
224 |
00264: |
l00264: |
if s7 = 0 |
stack push already made ? |
The 4 level stack |
248 |
00310: |
|
if s5 = 0 |
blinking display error ? |
Misc. routines |
253 |
00315: |
dsp5: |
if s0 = 0 |
key down |
Display and Wait |
260 |
00324: |
|
if s8 = 0 |
key down not processed |
Display and Wait |
294 |
00363: |
|
if s11 = 0 |
EEX first or after mantissa |
Digits entry |
302 |
00371: |
den5: |
if s6 = 0 |
decimal point in entry ? |
Digits entry |
319 |
01006: |
|
if s9 = 0 |
arc cos? |
Trigonometry |
322 |
01011: |
tan16: |
if s5 = 0 |
arc sin? |
Trigonometry |
332 |
01023: |
|
if s10 = 0 |
square root? |
|
365 |
01061: |
|
if s1 = 0 |
trigo (tan, sin arc tan, arc sin)? |
Trigonometry |
367 |
01063: |
|
if s10 = 0 |
arc tan? |
Inverse trigonometry |
369 |
01065: |
|
if s5 = 0 |
ln? vs log |
Logarithms |
421 |
01150: |
|
if s9 = 0 |
return from inverse trigo |
Inverse trigonometry |
429 |
01160: |
|
if s1 = 0 |
trigo (see table above) |
Trigonometry |
467 |
01225: |
rtn11: |
if s1 = 0 |
trigo (see table above) |
Trigonometry |
604 |
02011: |
|
if s8 = 0 |
ex on return |
Exponential |
654 |
02073: |
|
if s9 = 0 |
ay on return |
Powers |
656 |
02075: |
|
if s5 = 0 |
ln on return |
Logarithms |
686 |
02131: |
pre23: |
if s2 = 0 |
prescaling exponent ? |
Exponential |
709 |
02160: |
|
if s2 = 0 |
prescaling exponent ? |
Exponential |
719 |
02172: |
nrm26: |
if s2 = 0 |
return from log base 10 |
Logarithms |
781 |
02261: |
|
if s1 = 0 |
trigo error (tan, sin) |
Trigonometry |
|
|
|
|
|
|
100 |
L00077: |
l00077: |
clear status |
ENTER key |
The 4 level stack |
133 |
L00135: |
of13: |
clear status |
return from math routines |
Output format |
Jacques Laporte
Friday, 03 March 2006