That's a long story what I want and I'm afraid my English too poor to explain

But I will try.
I never wrote any programs in Cobol but I have one customer who have an old DOS Cobol-application (16 bit, of course) with the direct port i/o access. This program was written in Microfocus Cobol V 2.5.22 - that's all I know.
This program should be running under NT which is a protected system and all port i/o operations are prohibited. Well, I wrote VDD and NT kernel-mode driver. My first attempt was based on "non-application port i/o intercept". This way does not requires any changes in Cobol program but works very slow and I was forced to use another way which requires to make changes in the Cobol program.
Windows NT provides the functions RegisterModule, UnregisterModule, and DispatchCall for a 16-bit application (DOS or Win16) to call a 32-bit VDD (the same as DLL). These functions can be included in a 16-bit application program to bridge the gap between the 16- and 32-bit environments. The problem is that our customer can not make these calls directly and I should write some "thunk".
The first way is to write small 16-bit module with the 16-bit "C" compiler then link an *.obj file to the cobol program. The problem is that I do not know what is an *.obj model used in Microfocus Cobol? It is a Microsoft model? Other? How the parameters are passed from the Cobol when some procedure is called? Through the stack? It is a C "stdcall" model? "pascal" model? How this compiler returns the function results? In CPU registers like AX?
The second way seems to be more simple. In VDD I can intercept any call to the DOS/BIOS functions from any DOS program. Then we can make call from the Cobol program to any unused INT number, pass parameteres through the registers, return results in the register also.
So I need this pseudocode:
AL <- Function number (0 - read port, 1 - write port)
BL <- Value to write
DX <- Port address
All other registers are not used
-----
Call INT XX (I will choose this number myself)
-----
Return result in AL
Move result to some variable
Thank you in advance,
Victor [sig][/sig]