www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/08/29/17:24:14

Xref: news2.mv.net comp.os.msdos.djgpp:8032
From: "Mike Marcelais" <michmarc AT microsoft DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: -segread() and dos.h
Date: 29 Aug 1996 18:21:14 GMT
Organization: Microsoft Corporation
Lines: 41
Message-ID: <01bb95d7$883802e0$ba27379d@michmarc2>
References: <199608290018 DOT UAA04849 AT fcshome DOT stoneham DOT ma DOT us>
NNTP-Posting-Host: 157.55.39.186
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp


fredex AT fcshome DOT stoneham DOT ma DOT us wrote in article
<199608290018 DOT UAA04849 AT fcshome DOT stoneham DOT ma DOT us>...
| 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:

| 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.

Well, if you need the segment registers for your program, you can always call
_go32_my_cs()  {to get the current CS}
_go32_my_ds()  {to get the current DS which I believe is also the current ES}
_go32_my_ss()  {to get the current SS}

FS is free for programmer use (if you really need it an `asm volatile("movw
%%fs,%1":"=q" (my_fs));' can fetch it for you.  my_fs is the destination
variable and can be local).  GS is reserved for the C runtime library.


-- 
+------------------------+----------------------+
| Mike Marcelais         | Excel Developer and  |
| michmarc AT microsoft DOT com | Magic Rules Guru     |
+------------------------+----------------------+
| Opinions expressed in this post are mine, and |
| do not necessarily reflect those of Microsoft |
+--= Moonstone Dragon =---------------= UDIC =--+

- Raw text -


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