TIP: Click on subject to list as thread! ANSI
echo: pascal
to: JASEN BETTS
from: SAM IZZO
date: 1998-04-17 17:14:00
subject: Re: Graphics resolution

 -=> Quoting Jasen Betts to JOEJARED@WEBWORLDINC.COM <=-
 JB> how about
 JB> xor bx,bx
 JB> mov bh,y
 JB> shr bx,1
 JB> shr bx,1
 JB> add bh,y
hmm... accessing variables twice here :)
mov di, x
mov ah, y
xor al, al
add di, ax
shr ax, 2 { i think we can pretty much assume 286+ :) }
add di, ax
of course, everyone knows that the fastest putpixel (yes i realise this 
hread
wasn't even about the fastest putpixel! :) is the one you incorporate 
irectly
into your code, rather than having to call an external function =)
 JB> there's a faster way using LEA to multiply by 5 but I can't remember
 JB> it. :( 
mov edx, y
lea edi, [edx*4+edx] { you can also do edx*2, edx*8, and i think edx*16 }
shl edi, 6
{ edi = y*320 }
but i don't think it's worth doing this in real mode.  i think it's because 
n
real mode, 32-bit instructions have the 66h opcode prefix, however in 
protected
mode they don't have this (which is why it's better to use 32-bit registers 
n
protected mode, rather than 16/8-bit registers).  i _think_ that's why this
method isn't so good, but i'm not exactly sure.  anyone??
sam
... SENILE.COM found...  Out Of Memory!.  
--- FMail/386 1.20+
---------------
* Origin: Comms Barrier BBS +61.3.9585.1112, +61.3.9583.6119 (3:632/533)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.