Mail Archives: djgpp/1999/07/03/13:10:29
On Fri, 2 Jul 1999 17:12:22 +1200, "David Mitchell"
<dmitchell AT inet DOT net DOT nz> wrote:
>aperes wrote in message <377b163a DOT 2813653 AT news DOT telepac DOT pt>...
>>
>>Please help me!
>>
>>I'm trying to write a routine that transfers the contents of a buffer
>>to video memory. This is my routine:
>>
>> FlipAsm(_my_ds(), (int) virtual_screen);
>
>you want to call it by:
> FlipAsm(_my_ds(), &virtual_screen);
>
>also:
>> asm("
>> 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 */
>
>
>This code is wrong. You are moving the Data segment to ES, whereas you want
>to move 0x0a000 to ES, and xorw %%si, %%si
>Then it should work. You don't need the video variable.
>
>David
>
>
Thanks for your help, David but didn't worked or maybe i didn't not
understood your explication.
Put diferentely, what i want is use the assembly instruction MOVS to
move the data in DS:SI (my virtual screen) onto ES:DI (my destiny, the
video memory). If in my C program my virtual screen is, for example,
VS[64000] how i set up DS, SI to pointer to VS and ES, DI to pointer
to video memory?
main() {
unsigned char VS[64000];
....
....
flip(VS) ;
....
}
void flip(char *buffer)
{
.....
/* how to set up DS:SI to pointer to buffer? */
/* how to set up ES:DI to pointer to video memory? */
MOVW $32000, %%CX
REP
MOVW
...
}
Excuse me my poor english and thanks for your help and
patient.
APeres
- Raw text -