Mail Archives: djgpp/1999/08/08/11:51:27
How can i translate this piece of code in Inline Assembler in DJGPP?
The code is in INTEL format and fills in the buffer (a video buffer)
with a color:
void Fill_Double_Buffer(int color)
{
_asm {
mov cx, double_buffer_size // size of buffer in WORDS
mov al, color
mov ah, al
les di, double_buffer <--- MY PROBLEM IS HERE!!!!
rep stosw
}
}
My try:
void Fill_Double_Buffer(unsigned char color)
{
short selector = _dos_ds;
short size = double_buffer_size;
asm("
pushw %%es
movw %0, %%es
movw %1, %%cx
movb %2, %%al
movb %%al, %%ah
??????????????? <------------ my big problem!
rep stosw
popw %%es"
:
: "g" (selector), "g" (size), "g" (color)
: "ax", "cx", "di"
);
}
Thanks in advance
Aperes
- Raw text -