delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/03/25/16:52:30

Message-ID: <38DCF570.4DD62F2A@ou.edu>
From: David Cleaver <davidis AT ou DOT edu>
X-Mailer: Mozilla 4.7 [en] (Win98; I)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: Re: I'm Back...
References: <38DBF7AF DOT A0786922 AT ou DOT edu> <38DC04C8 DOT 72C075C6 AT bigfoot DOT com> <38DC1398 DOT E1B15F0B AT ou DOT edu> <8bi4je$51gdn$2 AT fu-berlin DOT de>
Lines: 62
Date: Sat, 25 Mar 2000 11:20:48 -0600
NNTP-Posting-Host: 129.15.140.115
X-Complaints-To: usenet AT ou DOT edu
X-Trace: news.ou.edu 954004764 129.15.140.115 (Sat, 25 Mar 2000 11:19:24 CST)
NNTP-Posting-Date: Sat, 25 Mar 2000 11:19:24 CST
Organization: The University of Oklahoma
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

See below for my message...

Dieter Buerssner wrote:
> 
> 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

Thank you for posting your response.  But, because I don't understand
'asm', I would like to ask several questions regarding your post:

1.  Why did you change "rm" (selector) to "r" (selector)?
2.  Do the variables have to be put into some specific order? (like it
     seems you have done above.)
3.  Why wasn't an equal-sign put in front of the "rm" variable?
4.  Why did you choose zero for x, and one for offset, and two for len,
     and nothing for selector?
5.  I really don't know anything about cli/sti pairs (or an ISR)!
     What do these terms mean?

I know these are all probably n00bie questions, but there's only one way
to get better and thats through knowing the material pretty well,
right?  So, if anyone can offer an explanation of this I would be most
appreciative.  Thanks again for your time.

-David C.

- Raw text -


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