> MS-DOS v6 or v7.00 return for all 21.73 functions is actually "AL = 0,
> *CF unchanged*", which is the CP/M style error return for unsupported
> functions. If you take care to pre-init CY (Carry Flag set) before the
> call then these versions of DOS will return AX = 7300h, CY, as they
> will leave the Carry Flag unchanged. (Same for 21.71 functions used
> for the MS-DOS v7 LFN interfaces.)

There are a lot of functions (in various API's and BIOS and DOS) where 
returning with CF set (or unchanged) indicates an error and CF clear indicates 
success.  In general, if CF is part of the return for a function it is nearly 
always a good idea to preset CF to correspond to an error.  If a call doesn't 
return CF but instead returns something in a register or memory space, it's 
almost always a good idea to preset the register or memory with something that 
would never be returned as a legitimate value, if there is such a value, like 0 
or -1.  That's all just good programming practice.


_______________________________________________
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to