QDOS Internals

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

User Tools

Site Tools


Table of Contents


This trap saves a file from memory.

Call ParametersReturn Parameters
D0.B$49D0.LError return.
D1.L D1.LCorrupted.
D2.LLength of file D2.LPreserved.
A0.LChannel ID A0.LPreserved.
A1.LBase address of fileA1.LTop address of file.


ERR_NOChannel not open.
ERR_DFDrive full.


  • All registers not shown above are not used on entry and are preserved on exit.
  • D3.W should be set to -1 before this trap is called.
  • The base address in A1.L must be even.


The example below shows the use of this trap. It is assumed that A0 contains the file ID, that D2.L contains the length of the file and that the address of the file in ram has been set at fle(a6).

save    moveq   #fs_save,d0     ; $49
        moveq   #-1,d3          ; Timeout (must be -1)
        movea.l fle(a6),a1      ; Address of file
        trap    #3              ; Do it
        tst.l   d0              ; OK? . .
        bne     error           ; . . no!
qdosmsq/traps/trap_3/save.txt · Last modified: 2009/05/27 14:59 by george.gwilt