delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/12/15/10:01:01

From: lturcott AT compuserve DOT com
Subject: Re: Inline assembly question
Date: Mon, 15 Dec 1997 00:11:15 -0600
Message-ID: <882164794.925368334@dejanews.com>
Newsgroups: comp.os.msdos.djgpp
Organization: Deja News Posting Service
References: <01bd0717$ffc6c1e0$3ca1f482 AT default>
Lines: 33
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Hi Peter

> using __djgpp_nearptr_enable and then use direct acces to videomem.
> (SCREEN[offset]=col).
>
> put_pixel (int x,int y,unsigned char col)
> {
> asm ("
> movw _dos_page,%%es			(dos_page is preloaded with _dos_ds)
> movl $0xa0000,%%edi
> addl %%ebx,%%edi
> stosb
> :
> :"a"(col),"b"((y<<8)+(y<<6)+x)
> :"%eax,"%ebx",%edi"
> }
>
> It this way of plotting a pixel the same as the farpokeb (...) version??


Using __djgpp_nearptr_enable should be a bit faster because you avoid
loading the ES register. But  !..., It may not work from a DPMI server to
an other.

Your code for putpixel should be OK and comparable to using farpokeb
One way to make it faster, is by creating PUTPIXEL as an inline macro
 (to avoid push, pop and ret)

Regards
Laurent Turcotte

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019