Try to learn something about everything, and everything about somethingThomas Huxley “Darwin's bulldog” (1824-1895)

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
public:calculator:guides:dm41_save_stats [09/02/26 07:31 GMT] – [Save Registers to Extended Memory] johnpublic:calculator:guides:dm41_save_stats [10/02/26 18:01 GMT] (current) – [Multiple Saved Files] john
Line 2: Line 2:
  
  
-====== DM41X Save/Restore Statistics ======+====== DM41 Save/Restore Statistics ======
  
 ** Using Extended Memory to save Statistics Registers ** ** Using Extended Memory to save Statistics Registers **
Line 14: Line 14:
 It is possible to save the 6 registers in a data file in Extended Memory and then use the statistics for other things, and restore the saved Statistics back to Main Memory when required. It is possible to save the 6 registers in a data file in Extended Memory and then use the statistics for other things, and restore the saved Statistics back to Main Memory when required.
  
-By Default the Statistics registers start at R11 but this can be changed with the command ''∑REG''+By Default the Statistics registers start at **R11** but this can be changed with the command ''∑REG''
  
 This is the default list of Statistics Registers and contents This is the default list of Statistics Registers and contents
Line 24: Line 24:
 |R15|∑xy|Summation of products of x- and y-values.| |R15|∑xy|Summation of products of x- and y-values.|
 |R16|n|Number of data points accumulated.| |R16|n|Number of data points accumulated.|
 +
 +**Advantage Pac : CFIT application ** seems to reset ''∑REG'' to **12**
 +
 ===== Extended Memory Data File ===== ===== Extended Memory Data File =====
  
Line 68: Line 71:
 This uses the query ''∑REG?'' to find the base register, then create ''bbb.eee'' using simple arithmetic. This uses the query ''∑REG?'' to find the base register, then create ''bbb.eee'' using simple arithmetic.
  
-When used in ''SAVES'' we ensure we copy the current Statistics Registers data.+When used in ''SAVER'' (save''R''egs) we ensure we copy the current Statistics Registers data.
  
-When used in ''GETS'' we ensure we restore our data to the Registers currently set to be the active Statistics Registers (they may have changed since first saving them)+When used in ''GETR'' (get''R''egs) we ensure we restore our data to the Registers currently set to be the active Statistics Registers (they may have changed since first saving them)
  
 <code> <code>
  
-LBL ¬SAVES+LBL ¬SAVER
 ¬REGS ¬REGS
 0 0
Line 84: Line 87:
 + +
 SAVERX SAVERX
-¬STATS SAVED+¬REGS SAVED
 AVIEW AVIEW
 PSE PSE
 CLD CLD
 RTN RTN
-LBL ¬GETS+LBL ¬GETR
 ¬REGS ¬REGS
 0 0
Line 99: Line 102:
 + +
 GETRX GETRX
-¬STATS OK+¬REGS OK
 AVIEW AVIEW
 PSE PSE
Line 108: Line 111:
  
  
 +===== Multiple Saved Files =====
  
 +It's possible to have more than one Extended Memory file with Stats registers.
  
 +This could keep track of different sets of statistics and allow restore, update, save for many sets of statistical data.
 +
 +I've set up **two** data files : ''REGS'' and ''CHESS'' in extended memory and made **two** version of the simple program above, the only change is to alter the lines which put the name of the file in ''ALPHA''
 +
 +
 +Then I thought of adding a 7th Register holding the ''DATE'' of the latest ''SAVE'' for the ''CHESS'' statistics, so I can keep track of whether I'm up to date in entering the scores.
 +
 +Delete the original ''CHESS'' Data File & make a new one with 7 registers 
 +
 +  * ''ALPHA'' -> ''CHESS''
 +  * execute ''PURFL''
 +  * ''X'' = ''7''
 +  * ''ALPHA'' still -> ''CHESS''
 +  * execute ''CRFLD'' to create the new 7-register data file
 +
 +
 +The date is automatically stored in the register just //after// the ''Stats'' - in general in ''R18'' when ''ΣREG'' is ''12'' - and automatically adapts the register used depending on ''ΣREG?''
 +
 +
 +Here is ''SAVEC'' and ''GETC'' for save''C''hess and get''C''hess
 +
 +
 +<code>
 +
 +LBL ¬SAVEC
 +¬CHESS
 +0
 +SEEKPTA
 +∑REG?
 +STO 01
 +6
 ++
 +STO 00
 +DATE
 +STO IND 00
 +RCL 01
 +1.001
 +*
 +.006
 ++
 +SAVERX
 +¬CHESS SAVED
 +AVIEW
 +PSE
 +CLD
 +RTN
 +END
 +
 +</code>
 +
 +<code>
 +LBL ¬GETC
 +¬CHESS
 +0
 +SEEKPTA
 +∑REG?
 +STO 01
 +6
 ++
 +STO 00
 +RCL 01
 +1.001
 +*
 +.006
 ++
 +GETRX
 +CLA
 +RCL IND 00
 +¬LAST 
 +ADATE
 +AVIEW
 +PSE
 +CLD
 +RTN
 +END
 +
 +</code>
 +===== Further Ideas =====
  
-===== Further Information =====+I might make a better version which prompts for a Data File name rather than having one separate program for each scenario
  
  
-{{tag>}}+{{tag>calculator dm41x dm41l}}
  
  

Navigation