qdosmsq:traps:trap_3:save

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

qdosmsq:traps:trap_3:save [2009/05/27 15:59] (current)
george.gwilt created
Line 1: Line 1:
 +====== FS_SAVE/​IOF_SAVE ======
 +
 +
 +This trap saves a file from memory.
 +
 +^Call Parameters^^Return Parameters^^
 +|D0.B|$49|D0.L|Error return.|
 +|D1.L| |D1.L|Corrupted.|
 +|D2.L|Length of file |D2.L|Preserved.|
 +|D3.W|Timeout|D3.L|Preserved.|
 +|A0.L|Channel ID |A0.L|Preserved.|
 +|A1.L|Base address of file|A1.L|Top address of file.|
 +
 +===== Errors =====
 +
 +
 +|ERR_NO|Channel not open.|
 +|ERR_DF|Drive full.|
 +
 +
 +===== Notes =====
 +  * 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.
 +
 +===== Example =====
 +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).
 +
 +<​code>​
 +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!
 +</​code>​
  
  • qdosmsq/traps/trap_3/save.txt
  • Last modified: 2009/05/27 15:59
  • by george.gwilt