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 pointer position.

Call ParametersReturn Parameters
D0.B $7B D0.L Error return
D1.L x,y coordinates D1.L x,y coordinates
D2.W Origin key D2.L Preserved
D3.W Timeout D3.L Preserved
A0.L Channel ID A0.L Preserved


ERR_NOChannel not open
ER_OR Out of range


  • All registers not mentioned above are preserved.
  • The origin key in D2.W has the following effect:
    • -1 sets the pointer relative to the current window definition.
    • 0 sets the pointer to the absolute position in D1.
    • 1 sets the pointer relative to the hit area.
  • The position returned in D1 is in absolute coordinates.


The example here shows the pointer set to the top left of the screen. It is assumed that on entry A4 points to the working definition.

        movea.l    ww_chid(a4),a0   ; Set the channel ID (ww_chid = 8)
        moveq      #0,d1            ; Position 0,0 . .
        moveq      #9,d2            ; . . absolute
        moveq      #IOP_SPTR,d0
        trap       #3
        tst.l      d0               ; Errors? . .
        bne        err ---->        ; . . yes!
qdosmsq/pe/sptr.txt · Last modified: 2009/02/11 15:54 by george.gwilt