QDOS Internals

Anything you never knew you wanted to know about the Sinclair QL.

User Tools

Site Tools



Activate a newly created job.

Call ParametersReturn Parameters
D0.B$0AD0.LError code.
D1.LId of the job to be activated.D1.LPreserved.
D2.BJob's priority. See notes below.D2.LUndefined. See notes below.
D3.WTimeout.D3.LUndefined. See notes below.
A0.LUnused. A0.LBase address of activated job.
A3.LUnused. A3.LPreserved if D3.W is zero, corrupted otherwise.


ERR_NJInvalid job id.
ERR_NCNot complete (Job is already active).


  • All registers not shown above are not used on entry and are preserved on exit.
  • If the timeout in D3.W is zero, then this equates to EXEC or EX and the job doing the activation will continue to run. Otherwise, it will wait for the activated to complete before continuing. Dickens indicates that D3.W should be 0 or -1. Pennell refers to the value as 0 or <>0. Best to assume 0 or -1.
  • A3.L is corrupted if the timeout was not zero on entry.
  • The priority passed in D2.B is documented as being in the range 0 to 127, however, it appears that values from 0 to 255 can be used.
  • Dickens states that D2 and D3 are preserved and Pennell says corrupted. Best to assume the worst and consider them corrupted.
  • This trap always exits via the job scheduler, so it is not atomic.
  • When the job is created by MT_CJOB, all registers except A4 to A7 are zero. A6 points to the start of code, ie to just after the end of the $68 byte header block. (A6,A4) points to the start of the data area and (A6,A5) points to just after the end of the data area. A7 is set to A6 + A5 -4. Before calling MT_ACTIV it is possible for a programmer to alter the contents of any of these registers. For example the SuperBASIC commands EX and EW can set channel IDs and a parameter string on the stack. Their code achieves this by altering the contents of the stack and also the value of A7 as stored in the job's header, before calling MT_ACTIV.


The following shows the use of this call :

        moveq   #mt_activ,d0    ; Trap code
        moveq   #<job_id>,d1    ; <job_id> is a known job id
        moveq   #32,d2          ; Standard default priority is 32
        moveq   #0,d3           ; Basically, EXEC the other job. Then
                                ; continue executing from here.
        trap    #1              ; Activate the job
qdosmsq/traps/trap_1/acjb.txt · Last modified: 2013/06/03 15:04 by george.gwilt