Mail Archives: djgpp/2000/03/25/16:52:30
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 -