FarewellLe 02/10/2012 à 00:14
Aller pour le plaisir :
;========================================================
;
; GetArchiveHandle
;
; Return the handle of the archive to process
;
; input a0 Archive name (C-string)
; ouput d0.w Handle of the archive if ERROR_CODE(a6) == AR_NO_ERROR. ERROR_CODE(a6) is set at the right value
; destroy std
;========================================================
GetArchiveHandle:
pea (a0)
moveq.l #$FFFFFFF8,d0 ; OTH_TAG
lea ArchiveSignature(pc),a1
jsr CHECK_FILE_TYPE(a6)
movea.l (sp)+,a0
moveq.l #AR_NOT_AN_ARCHIVE,d1
tst.w d0
beq.s \ArchiveFound
bpl.s \Quit
moveq.l #AR_ARCHIVE_NOT_FOUND,d1
bra.s \Quit
\ArchiveFound:
jsr GET_FILE_HANDLE(a6)
moveq.l #AR_NO_ERROR,d1
\Quit: move.w d1,ERROR_CODE(a6)
rts
T'es un amour Bob
