Mail Archives: djgpp/1996/10/28/17:01:07
Dean (deanh AT zip DOT com DOT au) wrote:
> void plot_pixel( int x, int y, unsigned char colour, short where ) {
> __asm__ ("
> movw %3, %%es\n
> movl $0xA0000, %%edi\n
Instead of this:
-------------------------
> movw %1, %%di\n
> movw %%di, %%ax\n
> shl $8, %%di\n
> shl $6, %%ax\n
-------------------------
try this:
movw %1, %%ax\n
xchg %%ax\n /* Same as shl $8, %%ax */
movw %%ax, %%di\n /* Now we have y << 8 in di */
shr $2, %%ax\n /* And this is same as shl $6, %%ax */
> addw %%ax, %%di\n
> addw %0, %%di\n
> movb %2, %%al\n
> stosb"
> :
> : "g" (x), "g" (y), "g" (colour), "g" (where)
> );
> }
>
I suggest you download PCGPE from site x2ftp.oulu.fi, directory
pub/msdos/programming/gpe. I think there are OpCodes with speeds.
--
-------------------------------------------------------------------------------
Blessed be, Moon Shade.
An ye harm none, do what ye will.
Hope never dies.
-------------------------------------------------------------------------------
- Raw text -