QDOS Internals

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

User Tools

Site Tools


Table of Contents


This trap fills a rectangular block in a window.

Call ParametersReturn Parameters
D0.B$2ED0.LError return.
D1.BColour D1.LCorrupted.
D3.WTimeout D3.LPreserved.
A0.LChannel ID A0.LPreserved.
A1.LAddress of block definitionA1.LCorrupted.


ERR_NCNot complete.
ERR_NOChannel not open.
ERR_ORBlock outside window.


  • All registers not shown above are not used on entry and are preserved on exit.
  • A1.L points to a block definition of four words:
    • X-size
    • Y-size
    • X-origin (relative to window origin)
    • Y-origin (relative to window origin)


The example below shows the use of this trap call to fill a block with grey stipple. It is assumed that A0 contains the window's ID.

blck    moveq   #sd_fill,d0     ; $2E
        moveq   #-1,d1          ; Grey stipple
        moveq   #-1,d3          ; Timeout
        lea     bk,a1           ; Block definition
        trap    #3              ; Draw the block
        tst.l   d0              ; OK? . .
        bne     error           ; . . no!

bk      dc.w    200,100         ; Size of block
        dc.w    10,20           ; Origin in window
qdosmsq/traps/trap_3/blok.txt · Last modified: 2009/05/17 14:26 by george.gwilt