delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/07/31/14:14:41

Message-Id: <199607311757.KAA27586@bluesky.com>
Comments: Authenticated sender is <kbaca AT bluesky>
From: kbaca AT skygames DOT com
To: dbarrett AT srvr1 DOT engin DOT umich DOT edu (David M Barrett)
Date: Wed, 31 Jul 1996 11:00:25 +0000
MIME-Version: 1.0
Subject: Re: Inline ASM : "Error: operands given ..."
CC: djgpp AT delorie DOT com

> 	ASM("                                   \n
> 		pushw %%es                      \n 
> 		movw _our_global_selector, %%es \n 
> --------------> movw %%es, %%ds                 \n 
                                      ^^^^^^ 
Can't do this.  A segment register can only be the destination of a
 move from a general purpose register (ax, bx, cx, dx) or it can be the 
destination of a pop instruction.

> 		movl $0xA0000, %%edi            \n 
> 		imulw $320, %%ax                \n 
> 		addw %%bx, %%ax                 \n 
> --------------> addw %%ax, %%edi                \n 
                                 ^^^^^^^
Can't do this either.  You have a 32 bit register as the destination 
of a 16 bit move.

[snip...]

In the future, you can find the exact line of the problem by 
compiling with -S and redirecting the output to a file, the run gcc 
on that file.  For example:

gcc -S foo.c > bar.s
gcc bar.s

-Kevin

- Raw text -


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