Archimedes

Previously, I developed a substantial Basic program for the Archimedes by organising its functionalities into distinct modules or procedures, each with a unique identification number. The modules were designed to interact with each other based on external events, creating a self-programming structure where the program could autonomously determine its next actions for a favourable outcome. A global variable called token% was used as a messenger.

When a module has completed its task, it updates token% to the identification number of the next task before returning control to the executive module, which then directs the program to execute the software in the module identified by the number in token%.

Any module can modify token% to the identification number of another module before returning control to the executive program.

The executive program is a simple loop that utilises if … then commands. Negative values of token% indicating anomalies or errors that require resolution. This systematic approach enhances the program’s efficiency and adaptability to changing circumstances.

Here is an extract of some the executive program:

DEF PROCtreat
token%=0 : REM initialise at switch-on time
REPEAT
PROCaction : REM do the radiotherapy
PROCresolve : REM deal with anomalies
UNTIL FALSE
EXNPROC
:
DEF PROCaction
IF token%=0 THEN PROCpower-up
IF token%=1 THEN PROCawait-new-entry
IF token%=2 THEN PROCget-pat-name
IF token%=3 THEN PROCget-pat-field
IF token%=4 THEN PROCwait4dose
IF token%=5 THEN PROCawait-exposure
IF token%=6 THEN PROCtreating
IF token%=7 THEN PROC . . . - you get the idea
ENDPROC
:
DEF PROCresolve
IF token%=-1 THEN PROCname-unknown
IF token%=-2 THEN PROCfield-not-known
IF token%=-3 THEN PROCstopped
IF token%=-4 THEN PROCnot-ready-to-expose
IF token%=-5 THEN PROC . . . and so on