Article View: comp.os.msdos.programmer
Article #2336Re: Stack Segment... Can I change it?
From: Ralf.Brown
Date: Sat, 22 Sep 1990 12:04
Date: Sat, 22 Sep 1990 12:04
25 lines
1800 bytes
1800 bytes
In article <8158@tekgvs.LABS.TEK.COM>, toma@tekgvs.LABS.TEK.COM (Tom Almy) wrote:
}In article <31074@nigel.ee.udel.edu> shearer@cis.udel.edu (Rob Shearer) writes:
}>I use TC++ version 1.0.
}>After the main() delcaration i would like to tell the system WHERE to use
}>the stack..
}>can I just poing _SS = FP_SEG(newlocation);
}> _SP = FP_OFF(newoffset);
}
}Several considerations (generic across any compiler for the 80x86):
}
}2. In the sequence you give above, you must make sure that the generated
} instruction that loads the SP immediately follows the one that loads SS.
} The mov ss,.. instruction automatically inhibits interrupts for one
} following instruction.
} If this is not the case, you will need to disable interupts while
} changing stacks.
You will also need to disable interrupts if the code can be run on an 8088,
as early versions of that chip have a microcode bug which results in
interrupts not being disabled for the instruction after a change to SS.
--
UUCP: {ucbvax,harvard}!cs.cmu.edu!ralf -=- 412-268-3053 (school) -=- FAX: ask
ARPA: ralf@cs.cmu.edu BIT: ralf%cs.cmu.edu@CMUCCVMA FIDO: 1:129/3.1
Disclaimer? | I was gratified to be able to answer promptly, and I did.
What's that? | I said I didn't know. --Mark Twain
Technical Details
Message-ID:
<26fb5350@ralf>Path:
arc1-ca.pugleaf.net!utzoo!attcan!utgpu!news-server.csri.toronto.edu!mailrus!iuvax!cica!tut.cis.ohio-state.edu!pt.cs.cmu.edu!b.gp.cs.cmu.edu!Ralf.Brown@B.GP.CS.CMU.EDUShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!news-server.csri.toronto.edu!mailrus!iuvax!cica!tut.cis.ohio-state.edu!pt.cs.cmu.edu!b.gp.cs.cmu.edu!Ralf.Brown@B.GP.CS.CMU.EDU From: Ralf.Brown@B.GP.CS.CMU.EDU Newsgroups: comp.os.msdos.programmer Subject: Re: Stack Segment... Can I change it? Message-ID: <26fb5350@ralf> Date: 22 Sep 90 12:04:32 GMT Sender: ralf@b.gp.cs.cmu.edu Organization: Carnegie Mellon University School of Computer Science Lines: 25 In-Reply-To: <8158@tekgvs.LABS.TEK.COM>