Mail Archives: djgpp/2000/03/24/01:33:20
Something like this:
--------------8<------------------
void putpixel (long x, long y, char color) {
if (VGAAddr)
*(VGAAddr+x+y2addr(y)) = color;
else {
__asm__ __volatile__ ("
pushw %%es
movw %3, %%ax
movw %%ax, %%es
movl %1, %%edi
shl $6, %%edi
movl %%edi, %%eax
shl $2, %%eax
addl %%eax, %%edi
addl %0, %%edi
movb %2, %%al
stosb
popw %%es"
:
: "g" (x), "g" (y), "g" (color), "g" (VGA_sel)
);
};
}
--------------8<------------------
Better find and read the FAQ it's somewhere on the web:
http://www.delorie.com/dgjpp/doc/
http://www.rt66.com/~brennan/djgpp/bgtia.html
http://sag-www.ssl.berkeley.edu/~korpela/djgpp_asm.html
www.castle.net/~avly/djgpp.html
Good Luck
bobbi AT integrityonline DOT com wrote:
>
> How do you do inline assembly code with DJGPP?
> -Scott
--
Alexei A. Frounze
- Raw text -