Mail Archives: djgpp/1999/03/04/21:07:04
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 -