QDOS Internals

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

User Tools

Site Tools



These traps set the position of the cursor.

TrapValue in D0.BAction
SD_POS/IOW_SCUR$10Set cursor using character co-ordinates
SD_TAB/IOW_SCOL$11Set cursor to the horizontal character position
SD_NL/IOW_NEWL$12Set cursor to start of next line
SD_PCOL/IOW_PCOL$13Move cursor to previous character
SD_NCOL/IOW_NCOL$14Move cursor to next character
SD_PROW/IOW_PROW$15Move cursor to previous line
SD_NROW/IOW_NROW$16Move cursor to next line
Call ParametersReturn Parameters
D0.BSee aboveD0.LCorrupted?
D1.LColumn number D1.LCorrupted.
D2.LRow number D2.LPreserved.
A0.LChannel ID A0.LPreserved.


ERR_NCNot complete.
ERR_NOChannel not open.
ERR_ORPosition out of window


  • All registers not shown above are not used on entry and are preserved on exit.
  • The value in D1 is only relevant for SD_POS/IOW_SCUR and SD_TAB/IOW_SCOL.
  • The value in D2 is only needed for SD_POS/IOW_SCUR.
  • Any pending newline is cancelled by these traps.
  • If there is an error the cursor position is unchanged.
  • SD_NL/IOW_NEWL will return "out of range" if the cursor is at the bottom of the window.


The example below shows the use of this trap call to place the cursor to a particular character position in the window. It is assumed that A0 contains the channel ID.

place   moveq   #-1,d3          ; Timeout
        moveq   #4,d1           ; To the fifth character . .
        moveq   #6,d2           ; . . on the seventh line
        moveq   #sd_pos,d0      ; $10
        trap    #3              ; Set the cursor
        tst.l   d0              ; OK? . .
        bne     error           ; . . no!
qdosmsq/traps/trap_3/scur.txt · Last modified: 2021/12/17 11:12 by norman