which programming language is suitable for this task?

48 Views Asked by At

I am giving a task to write code in any possible language to run a 16bit application (.exe), currently window's do not support a 16bit application because it old. How do I solve this problem?

  1. which programming language is suitable for this task? (From my opinion ** I am thinking of writing an emulator to run the app but how do I go about this? ) please I need all the system engineers, reverse engineer and software developer suggestions thanks

I have tried using python but I am unable to communicate to the programme seamlessly and forgot to mention - this app can't run in DosBox

2

There are 2 best solutions below

0
Martie On

You can buid and run 16 bit applications in DOSBox: www.dosbox.com. From the DOSBox website:

DOSBox is a DOS-emulator that uses the SDL-library which makes DOSBox very easy to port to different platforms. DOSBox has already been ported to many different platforms, such as Windows, BeOS, Linux, MacOS X...

DOSBox also emulates CPU:286/386 realmode/protected mode, Directory FileSystem/XMS/EMS, Tandy/Hercules/CGA/EGA/VGA/VESA graphics, a SoundBlaster/Gravis Ultra Sound card for excellent sound compatibility with older games...

You can "re-live" the good old days with the help of DOSBox, it can run plenty of the old classics that don't run on your new computer!

DOSBox is totally free of charge and Open Source.

Check our Downloads page for the most recent DOSBox version.

You can install Turbo-C 2.0 on DOSBox to build your own 16 bits Executable programs.

0
Clifford On

Writing your own emulator is rather a sledge-hammer to crack a nut, and while it might be an interesting academic exercise, it is a non-trivial undertaking and not a practical means of achieving the aim of simply running 16-bit code. The emulator would first have to be complete enough to run DOS let alone your intended application.

It is also unnecessary, there are existing solutions. The simplest method is probably to use DOSBox - DOSBox is and emulator and available across many platforms. It emulates both the x86 platform, PC hardware (including graphics adapters) and the MS-DOS OS. It is not however a complete implementation, omits some features such as long file names and is focused on running old games rather then development.

A more powerful solution is to install a genuine MS-DOS (if you have it), or FreeDOS if you don't, on a virtual machine such VirtualBox or VMWare. Details of doing that can be found at https://www.instructables.com/How-To-Install-DOS-622-Under-VirtualBox/. That will give you greater compatibility, and possibly better performance that DOSBox.

Language choice is very wide. DJGPP is a good starting point being GCC 9 or 10 based so relatively modern, and supports C, C++, Objective-C/C++, Ada, Fortran, and Pascal. Strictly GJGPP generated 32-bit code running on DPMI (DOS Protected Mode Interface), so if you strictly wanted to run 16 bit code, this may not be an option, but that seems an unnecessarily restrictive requirement.

If you have installed a genuine MS-DOS 6.22 it comes with QBasic of course, but it is somewhat limited and a virtually "dead language".

Lots of other development tools as well as other technical information are listed on the FreeDOS site: https://www.freedos.org/about/devel/ OpenWatcom being their preferred choice. All these will run on MS-DOS too and probably also DOSBox.

If you really want to run Python on DOS, then that is possible via https://www.caddit.net/pythond/ (that is built using DJGPP apparently).