I think I can imagine what you're trying to do here. I don't know much about microcontroller, but maybe you can do the following:
I think the easiest way is via parallel port. You must find out which pin can receive TTL input. Supply logic HI to the pin, observe the value at x0378 (or 0x379, or whatever. I don't know exactly).
For this you may want to create a simple program to loop forever and read the value at the input port while doing so. Play around with the supply voltage at the input pin. Note down what is the value when there is no supply (logic LO) and the value when there is logic HI. Remember those numbers.
Now, if under real DOS mode and no other programs running, with your target program running and continuously monitoring the value at the input port you can let the program do whatever you want once it detect the value for logic HI.
Now, that's just for one input pin. Once you get the hang of this then maybe you want to expand the idea to handle more input pins, where the values are to be read at the same input port.
Actually each input pin of the parallel port will either set or reset individual bits that make up the whole input port value. ( <-- do you understand this sentence?! )
I don't know much if it involves Windows environment, and other than parallel port.