You can't do that not only in Windows 10 but in fact in any Windows that runs applications in protected mode (Windows NT 3 and newer) - the application doesn't have direct access to interrupts and HW. Additionally, the executable format itself is OS-dependent. While there is some backwards compatibility (e.g. Win10 should be able to run Win7 apps) but it definetely doesn't stretch back to the DOS days (.COM format is by definition restricted to Real mode, that died before Win NT 3).
There is no direct way to convert this code to be Win10-compatible. You'll need to use OS-provided APIs to access the interrupts/HW.