This trap sets a file header.
Call Parameters | Return Parameters | ||
---|---|---|---|
D0.B | $46 | D0.L | Error return. |
D1.L | D1.W | Length of header set. | |
D3.W | Timeout | D3.L | Preserved. |
A0.L | Channel ID | A0.L | Preserved. |
A1.L | Base of header definition | A1.L | End of header definition. |
ERR_NC | Not complete. |
ERR_NO | Channel not open. |
The example below shows the use of this trap call to increase the dataspace of a program by $1000 bytes. It is assumed that A0 contains the file's ID and that a 64-byte buffer is at buf(A6).
datsp moveq #fs_headr,d0 ; $47 moveq #64,d2 ; Space for 64-byte header moveq #-1,d3 ; Timeout lea buf(a6),a1 ; Buffer trap #3 ; Read header tst.l d0 ; OK . . bne error ; . . no! add.l #$1000,buf+6(a6) ; Add $1000 to the dataspace moveq #fs_heads,d0 ; $46 lea buf(a6),a1 ; Reset the header base address trap #3 ; Write header tst.l d0 ; OK . . bne error ; . . no!