Taskforce was published in QL WORLD’s Do It Yourself Toolkit Column in April 1989. The more or less monthly column is edited by Simon Goodwin and contains useful extensions to SuperBasic.
Taskforce is a Superbasic routine that can be used with Quill, Abacus, Archive, Easel and most other programs that do not normally multitask. It allows you to switch between them with CONTROl-C as if they were “well behaved” programs. This program does not have the bells and whistles of Taskmaster and Qram, but does offer several advantages – it uses very little memory (in fact, once a task is loaded, it uses no memory – it is a few lines of basic, needed only when you load new tasks. It is also free.
To use Taskforce, run it using LRUN FLP1_taskforce_bas (or Mdv1_ or whichever device it is stored on). The first prompt is “Enter the device and taskname”– respond by entering flp1_archive or mdv1_Quill or whatever program you wish to execute. The second prompt is “Enter reserved space in K”. At this prompt, enter the amount of memory you want to reserve for Basic or other tasks to be loaded. If you press <ENTER> at this prompt, no memory will be reserved.
CTRL-C is used to switch between loaded tasks and SuperBasic. Programs that do not have a ’legitamite’ cursor (eg. Quill, Archive, Abacus and Easel-note that the ’cursor does not flash – it’s really a position marker rather than a cursor) are given one. This ’real’ cursor usually appears in the upper left corner of the screen and does not interfere with the program being executed.
Note that screens are not saved. Most commercial programs have a key or key combination that redraws the screen. For the Psion set provided with the QL, press <SHIFT-F5> after you use <CTRL-C> and the screen for the program you switched to will be redrawn.
For further information on this program, see pages 26-28 of the April 1989 issue of QL WORLD.
100 REMark TASKFORCE utility program
110 REMark QL WORLD DIY Toolkit 3/89
120 REMark 1988 by Phil Spink
130 :
140 CLS#0
150 REMark Free RAM = (SV.BASIC) -(SV.FREE)
160 free_k =INT((SYS_L(16)-SYS_L(12))/1024)
170 PRINT#0; "TASKFORCE--QL World DIY Toolkit 3/89 by Phil Spink",,free_k; "K bytes free."
180 INPUT#0; \" Enter task name and device: "! task_name$
190 INPUT #0\" Enter reserved space in K : "!space$
200 :
210 REMark reserve memory and load task
220 space="0"&space$
230 IF space<free_k AND space>=1
240 DIM dummy$(space-1,1022)
250 END IF
260 IF SYS_W(96)=0:POKE_W SYS_VARS+96,1
270 task_tag=SYS_W(96)
280 EXEC task_name$
290 PAUSE 200: REMark Delay to allow memory allocation
300 :
310 REMark Enable cursor of task's first CON channel
320 ch_bas=SYS_L(120)
330 last_ch_num=SYS_W(114)
340 FOR ch_ptr=ch_bas TO ch_bas +last_ch_num * 4 STEP 4
350 REMark is the channel open ?
360 IF PEEK (ch_ptr)<>255
370 ch_def=PEEK_L(ch_ptr)
380 REMark is it's driver the same as for #0
390 IF PEEK_L(ch_def+4) = PEEK_L(PEEK_L(ch_bas)+4)
400 REMark is it owned by the correct task
410 IF PEEK_W(ch_def+8) = task_tag
420 REMark is it to big to be a SCR definition
430 IF PEEK_L(ch_def)>120
440 POKE ch_def + 67, 1:REMark set SD.CURF
450 EXIT ch_ptr
460 END IF
470 END IF
480 END IF
490 END IF
500 NEXT ch_ptr
510 PRINT \"W A R N I N G ! ! NO CON CHANNEL IN "!task_name$
520 END FOR ch_ptr
530 CLEAR
540 STOP
550 :
560 DEFine FuNction SYS_L(addr)
570 RETurn PEEK_L(SYS_VARS+addr)
580 END DEFine
590 :
600 DEFine FuNction SYS_W(addr)
610 RETurn PEEK_W(SYS_VARS+addr)
620 END DEFine
630 :
640 DEFine FuNction SYS_VARS
650 RETurn 163840
660 END DEFine
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.