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. |
ERR_NO | Channel not open. |
ERR_DF | Drive full. |
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!