DS != SS in Turbo C 2.0

Scott Amspoker scott at bbxsda.UUCP
Fri Feb 8 03:13:38 AEST 1991


In article <1991Feb7.105811.17817 at computing-maths.cardiff.ac.uk> rhl at 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   |



More information about the Comp.lang.c mailing list