🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #7981

Re: Need help in TSR (80x86 asm) calling C

#7981
From: Konrad Byers
Date: Thu, 25 Apr 1996 00:00
18 lines
1845 bytes
myao@mailhost.ecn.uoknor.edu (Minghua Yao) wrote:

>I have a C module which uses "fopen()" to open a file. When called by a C main(), the module works well and the file can be opened. But if this module is called by a TSR code (which is loaded at an interrupt not used by the DOS, and is executed by activating this interrupt), the file which does exist cannot be opened often times. Sometimes (seldom,though) the file can be opened. If so, the machine will die. The behavior seems to be undefinte.

>The working enviroment is DOS. I use 80x86 assembly for The TSR and Borland C for the C module. The C module is resident part of the TSR.

>Anybody's help will be greatly appreciated.

Dos is not reentrant. This means you can not make and calls to dos
when another dos call is already in progress.  If you do then the
results are undetermined. There are ways to determine when it is safe
to call dos and ways to set a flag so that as soon as it is ok the
dirty deed will be done then. It is rather a lot to explain but there
are many good books on the subject.

I hope I haven't insulted your intelligence but it sounds like this is
the problem if it works fine from main. l8r
Technical Details
Message-ID: <4lpjhk$c5e@thor.atcon.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <4ljfha$s8s@independence.ecn.uoknor.edu>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10d683,c9a50b8babe96bc5
X-Google-Attributes: gid10d683,public
X-Google-Thread: 10f6aa,c9a50b8babe96bc5
X-Google-Attributes: gid10f6aa,public
X-Google-Thread: f7d8d,c9a50b8babe96bc5
X-Google-Attributes: gidf7d8d,public
From: aa176@ccn.cs.dal.ca (Konrad Byers)
Subject: Re: Need help in TSR (80x86 asm) calling C
Date: 1996/04/25
Message-ID: <4lpjhk$c5e@thor.atcon.com>
X-Deja-AN: 151490744
references: <4ljfha$s8s@independence.ecn.uoknor.edu>
organization: Atlantic Connect
reply-to: aa176@ccn.cs.dal.ca
newsgroups: comp.os.msdos.programmer,alt.lang.asm,aus.computers.ibm-pc