Date : Mon, 28 Feb 2005 23:09:30 +0000
From : jgh@... (Jonathan Graham Harston)
Subject: Re: ADFS OSWord &72 control block byte zero
James Lampard <james_lampard@...> wrote:
> I think you've got it the wrong way round.
> ADFS returns 1 if the call was sucessfull >1 =error
> code (so ADFS had a go at it)
Going out on a limb, I'd say *nothing* returns non-zero to
indicate no error. It's standard practice to be able to use:
IF result% THEN PRINT "Error: ";result%
and
BEQ no_error
BNE report_error_number
There is only one way that a routine can be successful, there are
an infinity of ways a routine can fail. There is only one zero,
there are an infinity of non-zeros.
Quoting from the Master Reference Manual, pJ.11-13:
"On exit, XY+0 contains 0 if the operation was completed
successfully; any other value indicates a disc error".
Examining the ADFS code also indicates that this is correct. When
ADFS calls the SCSI subsystem code (the code that OSWORD &72
calls) it ends with:
AND #&7F :\ Lose bit 7
BNE scsi_error :\ A<>0, generate an error
RTS :\ A=0, no error, all ok.
> It *stays* at zero if no ADFS.
The whole control block stays unchanged is there is no ADFS. As
the specification says to enter OSWORD &72 with XY+0, there is no
way of telling from just examining XY+0 if the call has returned
successfully (XY+0=0) or ADFS is absent (XY+0 unchanged).
> You could have a problem if your IDE command happened
> to be the same as one of the error codes and was used
> on a machine without ADFS.
No, the command codes go *inwards* and in XY+5.
--
J.G.Harston - jgh@... - mdfs.net/User/JGH
Badly formed email is deleted unseen as spam