delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/09/01/16:02:28

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: <Pine DOT OSF DOT 3 DOT 96 DOT 970819023856 DOT 6408A-100000 AT alpha DOT hut DOT fi>
NNTP-Posting-Host: mack.rt66.com
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

In article <Pine DOT OSF DOT 3 DOT 96 DOT 970819023856 DOT 6408A-100000 AT alpha DOT hut DOT fi>,
Samuli Takala  <tax AT cc DOT hut DOT fi> 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   |  <http://brennan.home.ml.org>                          -O

- Raw text -


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