中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-09-15 00:05
47,812 topics / 349,917 posts / today 0 new / 48,268 members
DOS开发编程 & 发展交流 (开发室) » How to call a function in the main program that triggered the interrupt in a DOS interrupt resident program?
Printable Version  1,794 / 1
Floor1 weishengshou Posted 2010-07-06 10:51
新手上路 Posts 6 Credits 19
Dear experts:

I wrote two programs:
1. A DOS program developed with Borland C++ 3.1
2. A terminating and staying resident (TSR) program. The development environment is the same.

In my program 1, I called the TSR, for example, interrupt number 1f.

Now the problem is: In the interrupt, I want to use a certain function in program 1, such as foo1(int arg1, int arg2, char **arg3). I don't want to directly write this function into the interrupt (this function triggers some other interrupts). I want to be able to call this function in program 1 when the interrupt is executed.

I don't have many ideas. Please give me some pointers, great experts.
Floor2 netwinxp Posted 2010-07-06 19:16
高级用户 Posts 366 Credits 741
Interrupt programs are at risk of reentrancy not only when directly using I/O and BIOS interrupt calls but also when making DOS calls.更何况calling user programs! If you want the interrupt service program to "communicate" with the user program, use register passing. If you think this function must be used, it's better to put it inside the interrupt rather than having the interrupt call the client program.

If you like to call user programs in an interrupt, you should use Windows, because Windows is designed that way, but its interrupt programs won't let you change them casually.

[ Last edited by netwinxp on 2010-7-6 at 19:22 ]
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023