Page 1 of 1

HELP!!!

Posted: Thu Sep 09, 2004 12:25 pm
by Charlie
use the djgpp compiler and i use

Code: Select all

asm("mov ah,00");
then the compiler gives me a error

c:/djgpp/tmp/ccXmpN7e.s: Assembler messages:
c:/djgpp/tmp/ccXmpN7e.s:153: Error: too many memory references for `mov

and i dont know what i have done wrong can somebody help me??

Re:HELP!!!

Posted: Thu Sep 09, 2004 1:26 pm
by IRBMe
DJGPP uses AT&T style syntax. You seem to be trying to use intel syntax.

Try this:

Code: Select all

asm ("movw $00, %ah")

Re:HELP!!!

Posted: Thu Sep 09, 2004 1:27 pm
by IRBMe
p.s. I found this on google. You might want to have a look at it:

http://www.delorie.com/djgpp/doc/brenna ... djgpp.html

Re:HELP!!!

Posted: Thu Sep 09, 2004 5:56 pm
by Dreamsmith
Incidently, in case you're baffled by the meaing of the error: your code is attempting to reference two memory locations, that of a variable named "ah" and memory location 0. Since Intel architecture instructions only reference one memory location in a single instruction (there's no "mov address1, address2" instruction), you get the "too many memory references" error.