Skip to content

INT 21h/AH=65h reports invalid function for an unavailable country/code-page pair #262

Description

@nakatamaho

Summary

For INT 21h Function 65h, an unavailable country/code-page pair should report error 2. The MS-DOS 3.3 Programmer's Reference says that a mismatched or invalid country/code-page pair returns AX=2, while CX below 5 returns error 1.

In FDOS/kernel commit d6791add2043c9d7b584d840a8ffaf8829fd2bdc, DosGetData() passes requests with no matching loaded NLS package to mux65(). The default MUX-14 handler, syscall_MUX14(), returns DE_INVLDFUNC when searchPackage() cannot find the requested pair. That error is propagated, so the unavailable-data path reports AX=1 instead of the documented AX=2.

Minimal call

With no matching NLS package/provider loaded:

  • INT 21h
  • AH=65h, AL=02h
  • BX=0437h
  • DX=FFFEh (unavailable country ID)
  • CX=0005h (minimum valid buffer size)
  • ES:DI points to a valid 5-byte buffer

Expected: carry set and AX=0002h.
Observed from the default source path at the commit above: carry set and AX=0001h (DE_INVLDFUNC).

Reference

Microsoft, MS-DOS Version 3.3 Programmer's Reference, “Get Extended Country Information (Function 65H),” Return and Comments sections: https://www.pcjs.org/documents/books/mspl13/msdos/dosref33/

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcompatibilityissue may effect compatibility

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions