🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.micro.pc
Article #8035

Re: A peculiar MASM problem

#8035
From: Charles Blair
Date: Fri, 26 Sep 1986 01:40
31 lines
2230 bytes

Well, I've solved my own problem, and I post the solution in case
anyone else runs into the problem described in the original posting,
and in case some knowledgeable person can offer some further
clarificatory words.

Both Norton (Programmer's Guide) and Ray Duncan in the new *Advanced
MSDOS* (Microsoft Press, 1986) point out that the SS and SP registers
need to be saved into variables within the code segment before
executing the EXEC function call, and need to be restored from those
variables right after control is returned to the program. I had been
doing this right before pushing all the other registers onto the stack
in preparation for making the call itself. This worked, except under
the conditions described in the previous posting. I have since moved
the definition of these variables to right after the beginning of the
code segment in the same module, i.e., out of the proc that made the
EXEC call. This seems to work fine. I decided that this might be the
problem after determining that when push failed, it failed right after
stepping through the two defines, one for SP and one for SS. Right
after those two lines were "executed," the code seemed to return to the
caller: the rest of the proc never got executed. I'd appreciate hearing
form anyone with a firmer grasp of what really went wrong here, i.e.,
what the real pitfalls are in making this call, and I apologize to the
non-MASMers who might be reading this. Thanks in advance.



-- 
Charles Blair   			    ..!ihnp4!gargoyle!sphinx!cjdb
The University of Chicago		    lib.cb%chip@UChicago.Bitnet
Technical Details
Message-ID: <651@sphinx.UChicago.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!decvax!ucbvax!ucbcad!nike!lll-crg!lll-lcc!qantel!ihnp4!gargoyle!sphinx!cjdb
References: <644@sphinx.UChicago.UUCP>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!decvax!ucbvax!ucbcad!nike!lll-crg!lll-lcc!qantel!ihnp4!gargoyle!sphinx!cjdb
From: cjdb@sphinx.UChicago.UUCP (Charles Blair)
Newsgroups: net.micro.pc
Subject: Re: A peculiar MASM problem
Message-ID: <651@sphinx.UChicago.UUCP>
Date: Thu, 25-Sep-86 21:40:20 EDT
Article-I.D.: sphinx.651
Posted: Thu Sep 25 21:40:20 1986
Date-Received: Sat, 27-Sep-86 19:27:16 EDT
References: <644@sphinx.UChicago.UUCP>
Reply-To: cjdb@sphinx.UUCP (Charles Blair)
Distribution: na
Organization: Univ. of Chicago Computation Center
Lines: 31
Keywords: Push/pop