Mail Archives: djgpp/1998/05/12/10:46:20
Tomas Kratochvil wrote:
> I have problem with inline assembler in DJGPP.
> I write this procedure in Borland C++ and I don`t how can I rewrite it
> to DJGPP. Please help me.
. . .
> asm { mov ax,0a000h
> mov es,ax
Actually, you have a few problems with inline assembler in DJGPP.
First there is the syntax. It is AT&T syntax, which is very different
from the Intel syntax you are used to. Either look at:
http://www.rt66.com/~brennan/djgpp/bgtia.html
to see how to use inline assembler in AT&T syntax, or change your
assembler code to be a callable subroutine rather than a piece of
a C routine. Then you can assemble the code with NASM (which is
close to the syntax you are used to) and link the resulting .o
file into a C program with djgpp.
Second, you should switch from 16 bit instructions to 32 bit
instructions. DJGPP runs all 32-bit. Every 16 bit instruction
requires one or two slow prefixes.
Third, you can't access physical addresses that way. Sorry I don't
have a URL handy to give the details, but it is in the FAQ.
--
http://www.erols.com/johnfine/
http://www.geocities.com/SiliconValley/Peaks/8600/
- Raw text -