delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/03/25/06:59:15

From: buers AT gmx DOT de (Dieter Buerssner)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: I'm Back...
Date: 25 Mar 2000 10:32:14 GMT
Lines: 39
Message-ID: <8bi4je$51gdn$2@fu-berlin.de>
References: <38DBF7AF DOT A0786922 AT ou DOT edu> <38DC04C8 DOT 72C075C6 AT bigfoot DOT com> <38DC1398 DOT E1B15F0B AT ou DOT edu>
NNTP-Posting-Host: pec-2-239.tnt2.s2.uunet.de (149.225.2.239)
Mime-Version: 1.0
X-Trace: fu-berlin.de 953980334 5292471 149.225.2.239 (16 [17104])
X-Posting-Agent: Hamster/1.3.13.0
User-Agent: Xnews/03.02.04
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

David Cleaver wrote:

>> > farptrx.h:13: Invalid 'asm' statement:
>> > farptrx.h:13: fixed or forbidden register 2 (cx) was spilled for
>> > class CREG.

[...]
>extern __inline__ void _farpokex (unsigned short selector, unsigned long
>offset, void *x, int len)
>{
>  __asm__ __volatile__ ("pushl %%es\n"
>                        "movw %w0, %%es\n"
>                        "rep\n"
>                        "movsb\n"
>                        "popl %%es"
>      :
>      : "rm" (selector), "S" (x), "D" (offset), "c" (len)
>      : "%ecx", "%edi", "%esi");
>}

Try the following (untested).

extern __inline__ void _farpokex (unsigned short selector,
                                  unsigned long offset,
                                  void *x, int len)
{
  __asm__ __volatile__ ("pushl %%es\n"
                        "movw %w3, %%es\n"
                        "rep\n"
                        "movsb\n"
                        "popl %%es"
      : "=S" (x), "=D" (offset), "=c" (len)
      : "r" (selector), "0" (x), "1" (offset), "2" (len));
}

But I wonder, whether it is allowed, to change es without
wrapping it into cli/sti pairs. (An ISR may assume stanard es)

-- Regards, Dieter

- Raw text -


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