DOS operating systems are seeing a resurgence in the embedded market.

My device uses ROM-DOS from Datalight with a NEC V30Mx processor, which provides the 80286 instruction set. ROM-DOS is roughly equal to MS-DOS 5.0 in my case

All functions and programs for PC work near normally. But the only problem comes from the keyboard which doesn’t feature the return key, but instead uses the EXE key which use a different keycode.
So when I usescanf(), I can input numbers and letters, but pressing the EXE key doesn’t validate the result. This makes it so I have no way for setting a variable from user input.

I don’t have enough assembler knowledge for Intel CPUs. So I can’t create something from scratch. But I guess changing the validation key code on an existingscanf()implementation would work.

Sincescanf()is part of the C standard library, every compiler should provide it. However, most C compilers for the DOS system are closed source. I checked gcc djggp, but they require an higher level of my instruction set (80386).

So is there a C compiler with an open source implementation or an alternative tofscanf() function family for setting variable from user input?

  • 3
    @RockPaperLizard : I found Open Watcom use lib286 however I can’t find the relevant code inside Open Watcom source code. Mar 22, 2015 at 20:05
  • 1
    OK, the key code for the EXE key is 0x1C00 which correspond to Alt Enter Mar 22, 2015 at 23:51


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.