QDOS Internals

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

User Tools

Site Tools


Table of Contents


This trap sets the cursor position by pixel.

Call ParametersReturn Parameters
D0.B$17D0.LError return.
D1.WX-coordinate D1.LCorrupted.
D2.WY-coordinate D2.LPreserved.
A0.LChannel ID A0.LPreserved.
A1.L A1.LCorrupted.


ERR_NCNot complete.
ERR_NOChannel not open.
ERR_OROut of window.


  • All registers not shown above are not used on entry and are preserved on exit.
  • The cursor is positioned by reference to the coordinates given in D1.W and D2.W. These are relative to top left of the window, which is at 0,0.
  • A pending newline is cancelled.
  • If an error is returned the cursor is not moved.
  • The cursor must be placed so that there is enough room in the window to print a character at the current size set by sd_setsz. Thus for the standard size, the cursor cannot be set closer than six pixels from the end of a line and no closer than ten pixels from the bottom of the window, otherwise the error ERR_OR is signalled.


The example below shows the use of this trap call to set the cursor inside the first character position. It is assumed that A0 contains the window's ID.

setp    moveq   #sd_pixp,d0     ; $17
        moveq   #4,d1           ; X-position
        moveq   #2,d2           ; Y-position
        moveq   #-1,d3          ; Timeout
        trap    #3              ; Set the cursor position
        tst.l   d0              ; OK? . .
        bne     error           ; . . no!
qdosmsq/traps/trap_3/spix.txt · Last modified: 2011/02/12 11:39 by george.gwilt