QDOS Internals

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

User Tools

Site Tools


Table of Contents


This trap sets a new owner of an open channel. SMSQ Only.

Call ParametersReturn Parameters
D0.B$05D0.LError code.
D1.LNew owner job's IDD1.LPreserved
A0.LChannel IDA0.LPreserved


ERR_NOChannel not found.
ERR_NJInvalid job (but see Notes).


  • All registers not mentioned above are unused and preserved.
  • The job ID in D1.L is not checked in the current version of this routine in SMSQE v3.13. Whatever job number is entered in D1.W is set in the channel block. Furthermore, if the channel is owned by an S*BASIC and so is given a basic channel number, this is still available to S*BASIC. So the ownership does not seem to be completely transferred. Perhaps this will be corrected in later versions.
  • DO NOT use -1 as the current job. This results in -1 being set in the channel as the owner.
  • Because the job ID is not checked, the error ERR_NJ, invalid job, cannot occur.


This example shows the channel whose ID is in A0 being set to the current job.

New_owner  move.l  a0,-(a7)   ; Keep channel ID
           moveq   #MT_INF,d0 ; To get system information
           trap    #1         ; D1.L contains the current job ID
           moveq   #5,d0      ; IOA_SOWN
           movea.l (a7)+,a0   ; Restore channel ID
           trap    #2         ; Alter owner to me
           tst.l   d0         ; OK? . .
           bne     oops       ; . . no!

; Now I own the channel
qdosmsq/traps/trap_2/sown.txt · Last modified: 2009/07/07 07:37 by norman