it's because MUL operations are among the slowest on the x86. while SHL/SHR bitwise operations are among the fastest. so you'd rather want to use SHL instead of the MUL to do Nx2 equations your PC during those times including writing to video memory.
pong --- fooler <[EMAIL PROTECTED]> wrote: > with this and using a high level language, the compiler > will going to use > MUL assembly code which will consume you 85 clock ticks! > multiply by 2 > (because of x * 2) is already 170 clock ticks! aside from > adding the MOV and > ADD clock ticks. > > while using your own code like this > > mov ax, Y > mov cx, 6 > shl ax, cx <--- Y * 32 > mov bx, ax > shl ax, 1 <-\ > shl ax, 1 <-\-- Y * 128 > add bx, ax BX = (Y * 32 + Y * 128) = Y * (32 + 128) > = Y * 160 __________________________________________________ Do You Yahoo!? Make a great connection at Yahoo! Personals. http://personals.yahoo.com _ Philippine Linux Users Group. Web site and archives at http://plug.linux.org.ph To leave: send "unsubscribe" in the body to [EMAIL PROTECTED] To subscribe to the Linux Newbies' List: send "subscribe" in the body to [EMAIL PROTECTED]
