QDOS Internals

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

User Tools

Site Tools



These traps clear the whole of a window or parts of it.

NameValue of D0.BAction
SD_CLEAR/IOW_CLRA$20Clear all window
SD_CLRTP/IOW_CLRT$21Clear top of window
SD_CLRBT/IOW_CLRB$22Clear bottom of window
SD_CLRLN/IOW_CLRL$23Clear all line
SD_CLRTT/IOW_CLRR$24Clear to line end
Call ParametersReturn Parameters
D0.BSee aboveD0.LCorrupted?
D1.L D1.LCorrupted.
D2.L D2.LPreserved.
A0.LChannel ID A0.LPreserved.
A1.L A1.LCorrupted.


ERR_NCNot complete.
ERR_NOChannel not open.


  • All registers not shown above are not used on entry and are preserved on exit.
  • When only a part of the window is to be cleared the part is defined by reference to the position of the cursor. The top of the window consists of all lines above the cursor line. The bottom of the window consists of all lines below the cursor line. When only a line is cleared it is the line on which the cursor lies. When only part of a line is cleared it is all positions to the end of the line including the cursor's position.


The example below shows the use of this trap call to clear a window. It is assumed that the channel ID is in A0.L.

clear   moveq   #SD_CLEAR,d0    ; $20
        moveq   #-1,d3          ; Timeout
        trap    #3              ; Clear window
        tst.l   d0              ; OK? . .
        bne     error           ; . . no!
qdosmsq/traps/trap_3/clra.txt · Last modified: 2009/05/10 15:52 by george.gwilt