www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/11/21/14:52:25

Date: Fri, 22 Nov 1996 08:41:24 +0000
From: Bill Currie <billc AT blackmagic DOT tait DOT co DOT nz>
Subject: Re: Trying to write to the Code Segment
To: "R.G. Morgan" <R DOT G DOT Morgan AT ncl DOT ac DOT uk>
Cc: djgpp AT delorie DOT com
Reply-to: billc AT blackmagic DOT tait DOT co DOT nz
Message-id: <32956734.5323@blackmagic.tait.co.nz>
Organization: Tait Electronics NZ
MIME-version: 1.0
References: <5715tb$s6f AT whitbeck DOT ncl DOT ac DOT uk>

R.G. Morgan wrote:
> 
>         I'm trying to add some 32-bit code on to the end of my code segment, and
> wondered if this is the right way of doing it:
> 
>         1) Get segment limit of code segment
>         2) Increase segment limit of code by about 4k
>         3) Get an alias selector for the selector in cs
>         4) Use __dpmi_get_descriptor to get descriptor, edit type field to
>            data/read-write
>         5) Use __dpmi_set_descriptor on alias to get writable data segment at
>            same addresses as the code segment.
>         6) Copy the code from the data segment (it's in a buffer) to the new
>            selector, which I've put in es.
> 

3,4 & 5 shouldn't be needed, ds,es and cs all point to the same range of
memory by default (though cs might have a shorter limit).


> PPS  do the asm constraints "esi" (foo), "edi" (bar) work? I seem to get errors
> if I try and use them.

That should be "S"(foor),"D"(bar)

Bill
-- 
Leave others their otherness.

- Raw text -


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