🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: TSR programming with MSC

#4652
From: Bob Eager
Date: Tue, 12 Feb 1991 13:06
20 lines
1755 bytes
In article <9042@hub.ucsb.edu>, spinrad@rigel.ucsb.edu writes:
> Originally I wrote an article which described that I had problems with printf
> from a TSR written in MSC.  I got many responses which said that this was 
> a reentrantcy problem.  Believing that I correctly handled the reentrancy
> issue, I wrote an assembly language routine which invoked int 21
> print string. I used this function instead of using MSC's printf in my
> TSR and everything worked fine.  Thus the problem was due to printf
> and not to reentrancy.

I would hazard a guess that your INT 21H call was the one with AH-9. Low
numbered calls tend to work OK (whether they're actuallty re-entrant or
use a different stack I'm not sure). printf almost certainly uses the
UNIX-style 'write' call which is around 40H (don't have the docs here).

Why not write your own printf, using a fixed buffer and vsprintf? Then output
the generated string with INT 21H AH=9?
-------------------------+-------------------------------------------------
Bob Eager                | University of Kent at Canterbury
                         | +44 227 764000 ext 7589
-------------------------+-------------------------------------------------
Technical Details
Message-ID: <21830.27b7e85d@cluster@ukc.ac.uk>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!uunet!mcsun!ukc!harrier.ukc.ac.uk!zodiac.ukc.ac.uk!cur022
References: <8646@hub.ucsb.edu> <1991Feb3.055420.5504@ys2.uucp> <2853@bimacs.BITNET> <9042@hub.ucsb.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!uunet!mcsun!ukc!harrier.ukc.ac.uk!zodiac.ukc.ac.uk!cur022
From: cur022%cluster@ukc.ac.uk (Bob Eager)
Newsgroups: comp.os.msdos.programmer
Subject: Re: TSR programming with MSC
Message-ID: <21830.27b7e85d@cluster@ukc.ac.uk>
Date: 12 Feb 91 13:06:37 GMT
References: <8646@hub.ucsb.edu> <1991Feb3.055420.5504@ys2.uucp> <2853@bimacs.BITNET> <9042@hub.ucsb.edu>
Distribution: comp
Organization: Computing Lab, University of Kent at Canterbury, UK.
Lines: 20