QDOS Internals

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

User Tools

Site Tools


This is an old revision of the document!


This trap frees previously allocated space in a user heap.

Call ParametersReturn Parameters
D1.LSize of area to be linked (back) in to the user heap. D1.LCorrupted.
D2.LUnused. D2.L Corrupted.
D3.LUnused. D3.L Corrupted.
A0.LAddress of the area of heap/memory to link (back) in to the user heap (Relative A6). A0.LCorrupted.
A1.LPointer to pointer to free space (Relative A6) or zero. A1.L Corrupted.
A2.LUnused. A2.L Corrupted.


No errors are returned by this trap.


  • All registers not shown above are not used on entry and are preserved

on exit.

  • A user heap is an area of memory, maybe in the common heap, set aside for use

by a single job. The job can allocate areas of this user heap for its own needs, and deallocate them as required. This stops, or reduces fragmentation of the common heap which is used by every task in the system. See here for more information on heaps.

  • If the long word at (A1,A6) is zero, then this trap will create a new user heap at the address in A1.
  • If (A1,A6) is not zero, then you are assumed to be releasing a previously allocated

chunk of user heap back into the user heap's free space.


This example show the use of this, and other, heap manipulation traps.

qdosmsq/traps/trap_1/rehp.1234432269.txt.gz · Last modified: 2009/02/12 09:51 by george.gwilt