QDOS Internals

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

User Tools

Site Tools



These traps define colour palettes.

TrapValue of D0.BAction
IOW_PALQ$60Define a QL palette
IOW_PAL8$61Define 8 bit palette
Call ParametersReturn Parameters
D0.BSee aboveD0.LCorrupted?
D1.LThe first element to set D1.LCorrupted?
D2.LThe number of elements to set D2.LCorrupted?
A0.LChannel ID A0.LPreserved?
A1.LAddress of PaletteA1.LCorrupted?


ERR_NCNot complete.
ERR_NOChannel not open.


  • All registers not shown above are not used on entry and are probably preserved on exit.
  • A1.L points to an area containing the D2.L elements to be set.
  • The elements are colours in true colour format, left justified.


The example below shows the use of this trap call to set the QL palette. It is assumed that A0 contains the channel ID.

QL_pal  lea     paltte,a1       ; Address of elements
        moveq   #-1,d3          ; Timeout
        moveq   #iow_palq,d0    ; $60
        moveq   #0,d1           ; First element
        moveq   #8,d2           ; Set all elements
        trap    #3              ; Set the palette
        tst.l   d0              ; OK? . .
        bne     error           ; . . no!

paltte  dc.l    $00000000       ; Black    0
        dc.l    $FFB6B600       ; Peach    1
        dc.l    $FF000000       ; Red      2  
        dc.l    $92B64900       ; Avocado  3
        dc.l    $00FF0000       ; Green    4
        dc.l    $0000FF00       ; Blue     5
        dc.l    $FF00FF00       ; Magenta  6
        dc.l    $FFFFFF00       ; White    7
qdosmsq/traps/trap_3/palq.txt · Last modified: 2009/05/15 10:37 by george.gwilt