Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!spool.mu.edu!uunet!ogicse!unmvax!bbx!bbxsda!scott From: scott@bbxsda.UUCP (Scott Amspoker) Newsgroups: comp.lang.c Subject: Re: DS != SS in Turbo C 2.0 Message-ID: <1708@bbxsda.UUCP> Date: 7 Feb 91 16:13:38 GMT References: <1991Feb7.105811.17817@computing-maths.cardiff.ac.uk> Reply-To: scott@bbxsda.UUCP (Scott Amspoker) Organization: Basis International, Albuquerque, NM Lines: 20 In article <1991Feb7.105811.17817@computing-maths.cardiff.ac.uk> rhl@computing-maths.cardiff.ac.uk (Robert Hartill) writes: >I want to use Turbo C's small memory model to write Interrupt Service Routines >for an operating system.. > >Since the ISRs are to use tasks stack space, their DS and SS are going to be > different, but TC assumes their the same. I want the ISRs to access kernel > data via DS (which never changes), so changing DS to SS inside the ISR isn't > good enough. Upon enterance to an interrupt handler, TC loads DS to point the main data segment of the application containing the interrupt handler. As you have pointed out, this could be different from the SS. This will not cause any trouble unless you take the address of something on the stack. (do not set a pointer to anything but global data). -- Scott Amspoker | Basis International, Albuquerque, NM | This space available (505) 345-5232 | unmvax.cs.unm.edu!bbx!bbxsda!scott |