www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/03/04/21:07:04

From: "John S. Fine" <johnfine AT erols DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: HELP! Assembly language dual mode interrupt handler for djgpp program
Date: Thu, 04 Mar 1999 20:56:24 -0500
Lines: 30
Message-ID: <36DF39C8.4C4E@erols.com>
References: <Pine DOT LNX DOT 3 DOT 96 DOT 990304202240 DOT 490A-100000 AT wzab DOT nasz DOT dom>
Mime-Version: 1.0
X-Trace: mpDeTI9qM8LozGI9xi9PUdZIzh1iDuvoT+5yk3+pYN8=
X-Complaints-To: abuse AT rcn DOT com
NNTP-Posting-Date: 5 Mar 1999 01:57:46 GMT
X-Mailer: Mozilla 3.01 (Win95; U)
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Wojciech Zabolotny wrote:

>         [SECTION .text]
> apps_cs         resw    1
> irq_handler     push    eax
>                 mov     ax,[cs:apps_cs]
>                 mov     ds,ax
> 
> However I don't know how to fill the "apps_cs" variable. It has to
> be located in the code segment (because at the begining of the interrupt
> CS is the only segment register with known contents), but I can not write
> to the code segment :-(.

  In DJGPP the code segment and data segment are always aliases
of each other.  That means app_cs is at the same offset relative
to cs or ds.

  You could easily write the ds selector there at any point in
your setup code.

> Is there any documented variable located in code segment which holds the
> DS for my application?

  Probably, but I don't know it :(
  For something this small, if you can't find it in the documentation
just roll your own.  You did most of that in the code above.  Just
store ds there and it's done.
-- 
http://www.erols.com/johnfine/
http://www.geocities.com/SiliconValley/Peaks/8600/

- Raw text -


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