🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

accessing ss and sp in C

#2351
From: Bill Langin[ftd]
Date: Mon, 24 Sep 1990 18:40
29 lines
1185 bytes
I have a bit of a small problem.  I am writing a TSR using PowerC.  What I want
to do is ressign the stack to a stack defined by the TSR when the TSR is 
activated and reset it upon exit.  

Using TurboC this is simple.  Just declare ss and sp properly and 

 ss = _SS;		/* ressign */
 sp = _SP;
_SS = new segment;
_SP = new pointer;
    .
    .
    .
_SS = ss;		/* reset */
_SP = sp;

However, since I'm using PowerC for other reasons, and it doesn't have 
equivalent "built-in register variables" I haven't been able to figure out a
way to do what I want.

Any ideas? 

Thanks in advance.

P.S. I'd like to not have to resort to assembly language if possible, since I
stink at it.

-- Bill Langin  -> My opinions are mine only... Go figure. 
INTERNET: wtl@ulysses.att.com  UUCP {att,decvax,ucbvax}!ulysses!wtl
Technical Details
Message-ID: <13788@ulysses.att.com>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!know!samsung!usc!ucsd!ucbvax!ulysses!ulysses.att.com!wtl

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!know!samsung!usc!ucsd!ucbvax!ulysses!ulysses.att.com!wtl
From: wtl@ulysses.att.com (Bill Langin[ftd])
Newsgroups: comp.os.msdos.programmer
Subject: accessing ss and sp in C
Keywords: PowerC,TurboC,TSR
Message-ID: <13788@ulysses.att.com>
Date: 24 Sep 90 18:40:10 GMT
Sender: netnews@ulysses.att.com
Lines: 29