QDOS Internals

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

User Tools

Site Tools



These vectors link and unlink an item into and from a list.

Call ParametersReturn Parameters
A0.LPointer to item.A0.LPreserved.
A1.LPointer to pointer to list.A1.LSee Notes.


No errors are returned by this vector call.


  • All registers not shown above are not used on entry and are preserved on exit.
  • A1.L is preserved for UT_LINK/MEM_LLST but corrupted for UT_UNLNK/MEM_RLST.
  • Each item must start with a long word which will be used to point to the next item.
  • When the list is first set up the pointer to the list should be zero.


The examples below show a list being started and an item being unlinked.

The pointer to the list is the long word at ptr(A6) and that items are located at item1(A6), item2(A6), item3(A6) etc.

Init_l  lea     ptr(a6),a1      ; Pointer to pointer to list.
        clr.l   (a1)            ; 1st pointer must be zero.
        lea     item1(a6),a0    ; Item to be set in the list
        movea.w UT_LINK,a2      ; UT_LINK vector address.
	jsr	(a2)		; Make the call
; Now ptr(a6) contains the address of item1(a6).

Unlink  lea     ptr(a6),a1      ; Pointer to pointer to list.
        lea     item2(a6),a0    ; Item to be unlinked.
        movea.w UT_UNLNK,a2     ; UT_UNLNK vector address.
	jsr	(a2)		; Make the call
qdosmsq/vectors/llst.txt · Last modified: 2009/02/16 15:36 by george.gwilt