From: brennan AT mack DOT rt66 DOT com (Brennan "Bas" Underwood) Newsgroups: comp.os.msdos.djgpp Subject: Re: inline asm putpixel routine using table Date: 31 Aug 1997 14:52:27 -0600 Organization: Acid Brain Lines: 23 Distribution: world Message-ID: <5uclib$3m3$1@mack.rt66.com> References: NNTP-Posting-Host: mack.rt66.com To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk In article , Samuli Takala wrote: >Problem here is that we are dealing with a 32-bit compiler so the size of >'int' is 32-bits. So to get the right offset to the screen_y array, you need >to multiply y by 4, not by 2: > shll $2, %%ebx > >> addl %%ds:_screen_y(%%ebx), %%edi >> movb %%al, %%es:(%%edi)" >> : /* no outputs */ >> : "g" (x), "g" (y), "a" (col), "g" (_dos_ds), "D" (0xA0000) >> : "eax", "ebx", "edi"); } > Right, but GCC is smart enough to turn a *320 into a shift and lea. No multiply will occur. Skip the table stuff. Brennan -- brennan AT rt66 DOT com | "Developing for Windows is not fun." -- John Carmack Riomhchlaraitheoir| Rasterfarian | -O