Date: Tue, 23 Sep 1997 20:24:00 -0700 (PDT) Message-Id: <199709240324.UAA02061@adit.ap.net> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" To: "M. Schulter" , djgpp AT delorie DOT com From: Nate Eldredge Subject: Re: inline asm problem with DJGPP Cc: jap AT mundiva DOT es Content-Transfer-Encoding: 8bit Precedence: bulk At 05:51 9/23/1997 GMT, M. Schulter wrote: >Javier Arriero País 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). >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 >: 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. You're quite right. The next problem that will be noticed is you'll get the wrong interrupt. Try this code: movb $0,%ah movb $0x13,%al int $0x10 Nate Eldredge eldredge AT ap DOT net