Definitions =========== CRC. Card Reader Circuit S Register Flags ================ S 1 = single step S 2 = running S 9 = auto_enter (=0 after CLx and ENTER) S 12 = data entry in progress (add digits to rhs) S 15 = key pressed S 0 = angle mode -(00=DEG,10=RAD,01=GRD) S 14 = angle mode / S 7 = (writing) a single sided card S 11 = ?in w/prgm mode? (display prgm step) S 3 = various. used to return state from CRC (ok/error/various flags set) S 4,6,7,8,10,13 = shift state (f g h STO RCL DSP or GTO pressed before now) RAM === 0-15 Data registers (STO/RCL 0-9,A-E; STI/RCI) 16-31 Program steps 113-224 32-47 Program steps 001-112 48-57 Secondary data registers (S0-S9) 58 unused? 59 unused? 60 unused? ram[61] = call stack & pc ------------------------- 00333222111ccc ccc= current pc 111= top item on stack (first RTN address) 222= next item on stack 333= last RTN address on stack pc format is nbr n= step in register (0-6) b= ram bank (1 or 2) r= register within bank (0-f) Step 001 is 62f (bank 2, reg f is ram[47]) 47: f20eb2f10eb1fa 00112233445566 Step 001 here is "fa" (= f LBL A) Step 002 is "b1" etc Step 008 is in ram[46] Step = ((b==2)? 120 : 232) - (r+1)*7 - (n+1) Incrementing a step is done by decrementing nbr (n=6..0 then r=15..0 then b=2..1) ram[62] = display format and flags ---------------------------------- ???????pdd0123 p = precision (DSP) dd = 22 FIX, 00 SCI, 40 ENG 0-3= flags 0-3 eg 62: 00000012220000 = fix2, no flags set ram[63] = ????? --------------- Mag Cards ========= 7 nibbles at a time 7 nibble chksum Header is 7 nibbles: tsfapmm t = type. 1=DATA 0-15, 2=DATA S0-S9, 3=PROG 001-112, 4=PROG 113-224. s = sides. 0= half of set. 1=complete. f = flags. =(F0? 8:0) + (F1? 4:0) + (F2? 2:0) + (F3? 1:0) a = angle mode. 0=DEG, 1=RAD, 2=GRD p = precision. from DSP. =0-9 mm= display mode. 00=SCI, 22=FIX, 40=ENG With a two-sided card (ie PROG 001-224, or DATA 0-26) both sides have s="0" and the calculator displays "Crd" after the first side loaded. With a single-sided card (short PROGs or DATA) s="1" and it skips the "ask for Crd and load more" step. See 65Notes V4N1 p9, or the microcode. There are 38 writes of 7 nibbles in the code; yet only 34 make it onto the card (65Notes V4N1 p5 "sequence of 952 bits. ... 238 4-bit words." 238/7= 34. 16 registers take 32 of those. That leaves the 7 nibble header and the 7 nibble checksum. The microcode actually writes 3 x 7 nibbles of sync at the start and 1 x 7 nibbles as a copy of the checksum at the end. Probably the sync wasn't detectable using the 65Notes process and the double checksum is possibly also handled internally by the card reader. Key Parts of the Microcode ========================== 00000 Power up 00161 hi im woodstock; then turn display on, clear last key press and enter the wait loop. 00167 - 00213 Wait loop. It cycles through this waiting for a key press, card insertion or RUN-W/PRGM switch. 00214 A key has been pressed. 00256 a -> rom address; switch (5*key.scanrow + key.scancol) 01205 Clear prefix state (0 -> S 4 6 7 8 10 13). To no f g h STO RCL DSP or GTO beforehand. 01740 same. used to start a prefix key (then only set ...). 06027 a -> rom address; switch (hex code for merged key step) 00124 \ 00135 \ 00142 -- all of these are wrapup after a function is finished CRC Instructions ================ CRC 60. set digits. Set the display_digits flag (purpose unk) CRC 100. ready? Test card reader is ready. s[3] always = 1 in emulator. Also clears card_inserted flag. CRC 160. digits? Test/Clear display_digits. s[3]= display_digits? 1 : 0; CRC 260. motor on. CRC 300. wprgm? Tests the RUN/PRGM switch. s[3]= wprgm? 1 : 0; CRC 360. motor off. CRC 400. set keypressed. Sets a flag. CRC 500. keypressed? Test/Clear the keypressed flag. s[3]= keypressed? 1 : 0; CRC 560. card_inserted? Test if card in reader. s[3]= card_inserted? 1 : 0; CRC 660. set write mode. CRC 760. init. Defaults to read mode CRC 1000. set defaults. Set the default functions flag. ie no program loaded. A-E do 1/x etc. CRC 1100. defaults? Test/Clear the default functions flag. s[3]= defaults? 1 : 0; CRC 1200. set merge. Set the merge flag. Used by g MERGE. CRC 1300. merge? Test/Clear the merge flag. s[3]= merge? 1 : 0; CRC 1400. set pause. Sets the pause (waiting for side 2 / "Crd") flag. CRC 1500. pause? Test/Clear the pause flag. s[3]= pause? 1 : 0; CRC 1700. read/write. Depends on whether in read mode or write mode.