www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/08/29/00:19:03

From: fredex AT fcshome DOT stoneham DOT ma DOT us
Message-Id: <199608290018.UAA04849@fcshome.stoneham.ma.us>
Subject: Re: -segread() and dos.h
To: fighteer AT cs DOT com (John M. Aldrich)
Date: Wed, 28 Aug 1996 20:18:50 -0400 (EDT)
Cc: djgpp AT delorie DOT com
In-Reply-To: <3223DDE9.27AD@cs.com> from "John M. Aldrich" at Aug 27, 96 10:49:29 pm

Thinking furiously, John M. Aldrich wrote:
> William Merril wrote:
> > When compiling the library, I get warnings that segread() is
> > implicitly defined, which it is.  segread should be defined in
> > dos.h, but I can't find it anywhere.
> > 
> > Does anyone have a suggestion or clue?
> 
> This may be a M$-specific function.  Please describe its purpose
> and we'll try to suggest a DJGPP equivalent.

From my (ancient ;-) docs for MSC 5.1:

------------------------------------------------------------------------------
Summary:

#include <dos.h>

void segread(segregs);
struct SREGS * segregs;

Description
 
The segread function fills the structure pointed to by segregs with
the current contents of the segment registers. The SREGS union is
described in the reference page for int86x. This function is intended
to be used with the intdosx and int86x functions to retrieve segment-
register values for later use.

Return Value

There is no return value

See Also

FP_SEG, intdosx, int86x

Example

#include <dos.h>
struct SREGS segregs;
unsigned int cs, ds, es, ss;

main()
	{
	segread (&segregs);	/* Read the segment register values */
	cs=segregs.cs;
	ds=segregs.ds;
	es=segregs.es;
	ss=segregs.ss;
	printf ("cs = %x, ds = %x, es = %x, ss = %x\n", cs, ds, es, ss);
	}

This program uses segread to obtain the current values of the segment
registers, then displays these values.
------------------------------------------------------------------------------

Obviously something that's of no value in a DJGPP program. Sounds like
that whole block of code needs to be rethought/redesigned.

Fred
-- 
-------------------------------------------------------------------------------
 .----    Fred Smith    /                        Office: fred AT computrition DOT com 
( /__  ,__.   __   __ /  __   : /                                 508-663-2524 
 /    /  /   /__) /  /  /__) .+'           Home: fredex AT fcshome DOT stoneham DOT ma DOT us 
/    /  (__ (___ (__(_ (___ / :__                                 617-438-5471 
-------------------------------- Jude 1:24,25 ---------------------------------

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019