Mail Archives: djgpp/1996/11/11/00:25:26
> __asm__ __volatile__ ("
> movw $16000, %%cx\n
> cld\n
> rep\n
> movsl"
> :
> :"D" (0xA0000+__djgpp_conventional_base), "S" (double_buffer)
> :"ax", "cx", "si", "di", "memory"
> );
Umm...looks like your mixing 32 and 16 bit operands here. Your count etc
is in 16 bit registers, and then your doing a 32 bit movs (movsl).
Shouldnt
your count then be in ecx? Your code should probably look something
like:
asm volatile ("
movl $16000, %%ecx;
cld;
rep;
movsl"
etc etc
Also, to access the video memory this way, you have to make sure you
have
the nearptr flag enabled or some similar such thing. This is in the FAQ
if
you haven't done this already...
> This fills the double buffer with one color (it should anyway)
>
> __asm__ __volatile__("
> movb %%al, %%ah\n
> movw %%ax, %%dx\n
> shl $16, %%ax\n
> movw %%dx, %%ax\n
> movw $16000, %%cx\n
> rep\n
> stosl"
> :
> :"a" (color), "D" (double_buffer)
> :"ax", "cx", "dx", "di", "memory"
> );
Same with this bit of code...
Leathal.
- Raw text -