Board index » delphi » Any tips?

Any tips?

        This is the putpixel routien I've been using for a while. I was just
wondering if anyone knew of any ways to speed it up at all (even just one
cycle):
        I'm using this routien in Protected mode, and FS is preloaded with the
selector for my offscreen buffer, which is where putpixel puts it's pixels.
        I've got it converted to inline code so there's no time wasted calling it
as a procedure.
        It's called as follows: putpixel(x,y,color : byte)
                pop ax
                pop di
                pop cx
                mov bx, di
                shl bx, 8
                shl di, 6
                add di, bx
                add di, cx
                mov fs:[di], al
 

Re:Any tips?


Quote
>This is the putpixel routien I've been using for a while. I was just
>wondering if anyone knew of any ways to speed it up at all (even just one
>cycle):
>I'm using this routien in Protected mode, and FS is preloaded with the
>selector for my offscreen buffer, which is where putpixel puts it's
>pixels.  I've got it converted to inline code so there's no time wasted
>calling it as a procedure.
> It's called as follows: putpixel(x,y,color : byte)
> pop ax
> pop di
> pop cx
> mov bx, di
> shl bx, 8
> shl di, 6
> add di, bx
> add di, cx
> mov fs:[di], al

You'd probably gain some less cycles, if you'd arrange 'em for a
pentium or you would use other registers than fs. (es or ds is
faster on a P5 w/o MMX)

Bye,
Stefan
---
please remove the P in my email-adress to answer me
take a look @ my homepage: http://sourcenet.home.pages.de/

Re:Any tips?


Quote
> >This is the putpixel routien I've been using for a while. I was just
> >wondering if anyone knew of any ways to speed it up at all (even just
one
> >cycle):
> >I'm using this routien in Protected mode, and FS is preloaded with the
> >selector for my offscreen buffer, which is where putpixel puts it's
> >pixels.  I've got it converted to inline code so there's no time wasted
> >calling it as a procedure.
> > It's called as follows: putpixel(x,y,color : byte)
> > pop ax
> > pop di
> > pop cx
> > mov bx, di
> > shl bx, 8
> > shl di, 6
> > add di, bx
> > add di, cx
> > mov fs:[di], al
> You'd probably gain some less cycles, if you'd arrange 'em for a
> pentium or you would use other registers than fs. (es or ds is
> faster on a P5 w/o MMX)

What's a good assembler that will assemble pentium code?  And where can I
get info on assembly registers & opcodes for pentium?

Other Threads