18. FILE_GET_HEAD

*------------------------------------------------------------------------------
* NAME          FILE_GET_HEAD
*------------------------------------------------------------------------------
* DEPENDENCY    None
* PURPOSE       To read the 64 bytes header for a file. (already open)
* DESCRIPTION   Reads a 64 byte file header for the open file whose ID is passed
*               in A0.L into the buffer (user supplied) whose address is passed
*               in A1.L. This buffer must be at least 64 bytes long !
* INPUTS :
*               A0.L = Channel ID
*               A1.L = Address of 64 byte buffer to put header into
* OUTPUTS :
*               D0 = Error code
*               D1 = Size of header read into buffer
*               A0 = Channel id (preserved)
*               A1 = Address of buffer (preserved)
*               Z flag set if no errors, unset otherwise.
*------------------------------------------------------------------------------
file_get_head   movem.l d2-d3/a0-a1,-(a7) ; Save those working registers
                moveq   #FS_HEADR,d0    ; Get trap code
                moveq   #64,d2          ; Buffer size
fgh_rest        moveq   #-1,d3          ; Infinity is a big thing
                trap    #3              ; Do it
                movem.l (a7)+,d2-d3/a0-a1 ; Restore thoise workers
                tst.l   d0              ; Set flags
                rts                     ; Return to caller