www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/09/23/23:26:01

Date: Tue, 23 Sep 1997 20:24:00 -0700 (PDT)
Message-Id: <199709240324.UAA02061@adit.ap.net>
Mime-Version: 1.0
To: "M. Schulter" <mschulter AT value DOT net>, djgpp AT delorie DOT com
From: Nate Eldredge <eldredge AT ap DOT net>
Subject: Re: inline asm problem with DJGPP
Cc: jap AT mundiva DOT es

At 05:51  9/23/1997 GMT, M. Schulter wrote:
>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).

>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.
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



- Raw text -


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