From: "M. Schulter" <mschulter AT value DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: inline asm problem with DJGPP
Date: 23 Sep 1997 05:51:38 GMT
Organization: Value Net Internetwork Services Inc.
Lines: 50
Message-ID: <607lda$805$1@vnetnews.value.net>
References: <01bcb53d$0b3b4f00$a4da4cc3 AT default>
NNTP-Posting-Host: value.net
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 8bit
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Precedence: bulk

Javier Arriero Pa�s <jap AT mundivia DOT es> wrote:

: When I write somethig like:
: 	asm("movb %ah,$0;
: 		movb %al,$0x13;
: 		int $10");
: I get a error message: "operators given don't match any 380 instruction"
: from assembler (as.exe).

Hi, there. Since I'm only a beginner, I could be wrong, and any case
would direct you to Section 17 of the DJGPP FAQ, and also the famous
tutorial by Brennan Bas Underwood on DJGPP assembly coding mentioned in
the FAQ.

Please also try

info as machine i386

for more information about the GNU assembler, its syntax, opcodes, and
other features.

In the meantime, my first reaction is that your syntax looks like the
opposite order from what the GNU assembler (GAS) expects.  Please note
that the source comes before the destination: 

movb $0, %ah    /* move immediate operand 0 into register %ah */
movb $0x13, %al   /* move immediate operand 0x13 into register %ah */

: Same days ago, I did't get any error... and I don't want to use <dpmi.h>
: If I write "movb %ah, 0" instead of "movb %ah,$0", i don't get any error,
: but my program don't change the graphic mode.
: What happen???

Let's see. According to the first portion of the assembly tutorial in
progress at

http://www.delorie.com/djgpp/doc/ug/asm/about-386.html

an operand not preceded with a % (register) or $ (immediate operand) is a
memory location or the like. So I guess you're moving the contents of %ah
to memory location 0 within the address space or whatever.

Most respectfully,

Margo Schulter
mschulter AT value DOT net

(To reply, please remove the extra . from my default address)