QDOS Internals

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

User Tools

Site Tools


Table of Contents


Find the maximum amount of free memory.

Call ParametersReturn Parameters
D1.LUnused D1.LMaximum free space in bytes.
D2.LUnused D2.LCorrupted.
D3.LUnused D3.LCorrupted.
A0.LUnused A0.LCorrupted.
A1.LUnused A1.LCorrupted.
A2.LUnused A2.LCorrupted.
A3.LUnused A3.LCorrupted.


No errors are returned by this trap.


  • All registers not shown above are not used on entry and are preserved on exit.
  • This trap returns the number of bytes in the biggest free area of Transient Program space or the number of bytes between SV_BASIC and SV_FREE minus 512 - whichever is the biggest.
  • Beware of the fact that by the time you have obtained the figure, you might still fail to allocate it all if another job has got there first and allocated some space for itself. LOL


The following shows the use of this call :

mfree   moveq   #06,d0          ; MT_FREE/SMS_FRTP
        trap    #1              ; Find amount of free space 
        <do stuff here with the number of bytes in D1.L>
qdosmsq/traps/trap_1/frtp.txt · Last modified: 2008/07/22 15:25 by norman