The following warnings occurred:
Warning [2] Undefined array key 141472 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $thread - Line: 295 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 295 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Trying to access array offset on value of type null - Line: 295 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 295 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $fid - Line: 295 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 295 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 141472 - Line: 331 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 331 errorHandler->error_callback
/inc/plugins/threaded_mode.php 304 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $theme - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Trying to access array offset on value of type null - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $theme - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Trying to access array offset on value of type null - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $lang - Line: 5 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 5 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Attempt to read property "messages_in_thread" on null - Line: 5 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 5 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks





35s filesystem



#2

I would like to continue on the topic of saving state in indexed registers.

Each program has specific set of registers it uses (or cares about).
When using calculator to run a different program these registers may be partially overwritten. Or, maybe the same program need to be run with slightly different set of input data and it is a hassle to switch beween them.

The idea is to use bitmask to specify which registers need to be saved and save them in the continuous stretch of index registers.
Each used register corresponds to 1 in a binary number, A being least significant bit. For example if program uses registers A,B,C,D,E, R, T, X then the mask is
08a001fh = 9043999. Together with 3 digit origin mask forms "filde descriptor". In this case possible "file descriptors" are 9043999000, 9043999008, 9043999016
The registers usage mask may be declared in program description or even be present somwhere in the program itself.

The program below is actually 3 programs under one roof to view, read and write working registers into indexed registers according to file descriptor.

fd XEQ J002 -- will view contents of a file
fd XEQ J003 -- will load working registers from indexed registers
fd XEQ J004 -- will save working registers into indexed registers

The load and save programs use "I" register so they cannot save/restore it -- I would appreciate any ideas on how to do this without too much hassle.

View program J002 also uses M register -- I believe it is ok in that specific case, but it would be much better if it did not.

I also would like to include a feature of saving a state, inclding stack and program counter -- to be able to interrupt long running program and return to it later.

The program is pretty straightforward -- it cycles through the set bits of a mask and for each set bit it increments I and saves content of a corresponding register to (I).

(Internal routine J005 separates mask from index origin and J014 calculates negative register index corresponding to the next set bit in a mask)

J001 LBL J     J018 -         J035 RTN       J052 x=0?      J069 RTN
J002 GTO J031 J019 AND J036 XEQ J014 J053 RTN J070 XEQ J014
J003 GTO J051 J020 XOR J037 Rv J054 XEQ J014 J071 x<> I
J004 GTO J067 J021 ENTER J038 XOR J055 RCL (I) J072 RCL (I)
J005 ENTER J022 LOG J039 STO M J056 x<>y J073 x<>y
J006 ENTER J023 2 J040 Rv J057 x<> I J074 x<> I
J007 1000 J024 LOG J041 Rv J058 x<>y J075 Rv
J008 RMDR J025 / J042 RCL I J059 STO (I) J076 STO (I)
J009 STO I J026 1.1 J043 1000 J060 CLx J077 CLx
J010 x<>y J027 + J044 / J061 1 J078 1
J011 LASTx J028 IP J045 - J062 + J079 STO+ I
J012 INT/ J029 +/- J046 RCL (I) J063 STO I J080 Rv
J013 RTN J030 RTN J047 STOP J064 Rv J081 XOR
J014 ENTER J031 XEQ J005 J048 1 J065 XOR J082 GTO J068
J015 ENTER J032 STO M J049 STO+ I J066 GTO J052
J016 ENTER J033 RCL M J050 GTO J033 J067 XEQ J005
J017 1 J034 x=0? J051 XEQ J005 J068 x=0?


Forum Jump: