Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

not setting carry (Developers)

posted by ecm Homepage E-mail, Düsseldorf, Germany, 16.10.2025, 16:17

> I believe unimplemented INT 21H functions with high AH don't set the carry
> flag, unlike ones with low AH. Instead, I think you are supposed to check
> AL? Now that we have the MSDOS 4.0 source code, do we know whether that is
> deliberate policy, and perhaps a reason for that policy, or whether it was
> an accident?

It is deliberate. The "high" functions use the MS-DOS v1 style error return, which consists of Carry Flag unchanged, al = 00h. This is why you can find information referencing an "error code" (in ax) of 7300h (FAT32 functions before MS-DOS v7.10), 7100h (LFN functions while MSW v4 isn't running), or even 6C00h (Extended Open/Create on MS-DOS v3.xx or DR-DOS up to v6.00).

To ensure that these odd "error codes" are detected properly, callers should ensure to stc before the int 21h call. Int 21h hooks ideally should preserve this Carry Flag status when chaining or calling their downlinks.

Unfortunately, this isn't properly documented much, including in the Interrupt List.

---
l

 

Complete thread:

Back to the forum
Board view  Mix view
22750 Postings in 2119 Threads, 402 registered users (0 online)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum