Mail Archives: djgpp/1997/09/23/23:26:01
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 -