Mail Archives: djgpp/1999/07/01/07:36:09
Please help me!
I'm trying to write a routine that transfers the contents of a buffer
to video memory. This is my routine:
int main(void)
{
unsigned char virtual_screen[64000];
set_mode_13h();
.....
FlipAsm(_my_ds(), (int) virtual_screen);
....
set_text_mode();
}
void FlipAsm(short buffer, int source)
{
short video;
video = _dos_ds;
asm("
PUSHL %%ES
PUSHL %%DS
MOVW %0, %%ES /* ES= video (%0) */
MOVW %1, %%DS /* DS= buffer (%1) = segmento dados */
MOVL $0xA0000, %%EAX
MOVL %%EAX, %%EDI /* EDI = Ax0000, ES:DI
MOVL %2, %%EAX
MOVL %%EAX, %%ESI /* ESI = source, DS:SI */
MOVW $32000, %%CX
REP
MOVSW
POPL %%DS
POPL %%ES
"
:
: "g" (video), "g" (buffer), "g" (source)
: "eax", "ecx", "edi", "esi"
);
}
The problem is that i can't pass to FlipAsm routine the correct adress
of variable virtual_screen. How can i do that?
(sorry my poor english)
- Raw text -