Xref: news2.mv.net comp.os.msdos.djgpp:5879 From: korpela AT islay DOT ssl DOT berkeley DOT edu (Eric J. Korpela) Newsgroups: comp.os.msdos.djgpp Subject: Re: Setpixel in AT&T inline asm.... Date: 11 Jul 1996 18:54:21 GMT Organization: Cal Berkeley-- Space Sciences Lab Lines: 37 Message-ID: <4s3ikt$ano@agate.berkeley.edu> References: <4rh0g5$m9r AT twain DOT mo DOT net> <4rj0kb$sf3 AT nef DOT ens DOT fr> NNTP-Posting-Host: islay.ssl.berkeley.edu To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp In article <4rj0kb$sf3 AT nef DOT ens DOT fr>, Pascal Massimino wrote: >In article <4rh0g5$m9r AT twain DOT mo DOT net>, vecna AT Walden DOT mo DOT net ([vecna]) writes: >|> I'm trying to write a simple putpixel to >|> a 320x200 virtual screen, which is already allocated and defined as: >|> >|> char *virscr; >|> >|> This is my (yes, unoptimized) setpixel routine: >|> > movl _y,%eax > imull $320,%eax > addl _x,%eax > movb _c,%cl > addl _virscr,%eax > movb %cl,(%eax) how about.... lookup_table[y][x]=c; where lookup_table is initialized at startup to... char **lookup_table for (i=0;i<200;i++) { lookup_table[i]=virscr+i*320; } It's bound to be faster than an imull. Eric -- Eric Korpela | An object at rest can never be korpela AT ssl DOT berkeley DOT edu | stopped. Click here for more info.