QDOS Internals

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

User Tools

Site Tools



Set a job's priority.

Call ParametersReturn Parameters
D0.B$0BD0.LError code.
D1.LId of the job to be prioritised.D1.LPreserved unless on entry it was -1 in which case it will become the Id of the current job.
D2.BJob's new priority. See notes below.D2.LPreserved.
A0.LUnused. A0.LBase address of prioritised job.


ERR_NJInvalid job id.


  • All registers not shown above are not used on entry and are preserved on exit.
  • 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.
  • This trap always exits via the job scheduler, so it is not atomic.
  • Note to self. Check D3.W. Should there not be a timeout on this trap call? My notes say is D3.W unused on entry and D3.L is preserved on exit. Doesn't seem right.


The following shows the use of this call to change the priority of the current job to a very low priority.

        moveq   #mt_prior,d0    ; Trap code
        moveq   #-1,d1          ; Change my own priority
        moveq   #1,d2           ; Set priority very low
        trap    #1              ; Change the priority
qdosmsq/traps/trap_1/spjb.txt · Last modified: 2015/09/18 07:47 by george.gwilt