QDOS Internals

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

User Tools

Site Tools




This trap calls an extended operation.

Call ParametersReturn Parameters
D0.B$09D0.LError return.
D1.LParameter D1.LReturned parameter.
D2.LParameter D2.LPreserved.
A0.LChannel ID A0.LPreserved.
A1.LParameterA1.LReturned parameter.
A2.LAddress of routineA2.LPreserved.


ERR_NCNot complete.
ERR_NOChannel not open.


  • All registers not shown above are not used on entry and are preserved on exit.
  • This trap allows additional functions to be added to screen drivers.
  • At entry A0.L points to the channel definition block and must not be altered by the routine. Note that if the Pointer Environment is present this address is $30 bytes after the start of the channel block.
  • At entry A6.L points to the system variables and must not be altered by the routine.
  • Parameters can be passed to the called routine in D1.L, D2.L and A1.L. Parameters can be returned by the routine in D1.L and A1.L.
  • The routine is executed in supervisor mode and must end with RTS with D0.L containing the error return and the condition codes set accordingly.


The example below shows the use of this trap call to alter the character height. This was suggested by Andrew Pennel in The Sinclair QDOS Companion. It is assumed that A0 contains the window's ID.

Note that the address sd_yinc(a0) will correctly access the height increment in the channel block whether PE is present or not.

chhgt   moveq   #sd_extop,d0    ; $09
        lea     conext,a2       ; EXTOP routine
        moveq   #-1,d3          ; Timeout
        trap    #3              ; Do the routine

conext  move.w  #9,sd_yinc(a0)  ; Set the height increment
        moveq   #0,d0           ; No error
qdosmsq/traps/trap_3/xtop.txt · Last modified: 2009/05/21 10:18 by george.gwilt