I wonder why I'm not allowed to replace:

(color_key is a DDCOLORKEY)
mov color_key.dwColorSpaceLowValue, 0

mov color_key.dwColorSpaceHighValue, 0

mov color_key, QWORD 0

It seems a if the compiler want me to add a PTR after the QWORD, but wouln't that mean something like "mov the qword @ 0 to color_key"?
Is there an better way of setting the color_key to zero fast, or is the two line code the only way?
Posted on 2002-07-15 11:49:54 by scientica
There is no instruction to move an immediate QWORD to a memory location - the MOV instruction doesn't support QWORDs at all.
Posted on 2002-07-15 11:57:53 by bitRAKE
immediate, erhm, sorry I realy never understood what that is.
:stupid: :stupid: :stupid:
Posted on 2002-07-15 12:03:25 by scientica
An actual number...

mov eax, 7

7 is the actual number you want to move, its not a pointer or some other storage (register or memory contents).

The only way you can fast zero the stuff is if you can use MMX, and have a free MMX register going (so you aren't using FPU, or really using the MMX register space).

pxor MM0, MM0
movq myQWORD, MM0

Posted on 2002-07-15 12:08:13 by Mirno
immediate, is a number. like 0, 37878, 0A47Fh,01010100b those types of numbers are called immediate when using with a instruction.
Posted on 2002-07-15 12:08:38 by Qages
I think it?s because the intel family of chips have evolved from 16 bits... so when the firsts models where designed they used mem native access was with 16-bits reg (i.e. AX), then iwith the 386 it evolved to 32 bits (EAX), but then... I think they don?t have more opcodes.

So MME which is pretty new uses QWORD, but there are no opcodes to access it like you would with words.

But one never knows, maybe they will in heptium... ;)
Posted on 2002-07-15 12:22:34 by slop
its called the 64bit microprossesor.
Posted on 2002-07-15 12:25:32 by Qages
U mean the pentium?
Posted on 2002-07-15 12:27:27 by slop
no i mean 64bit cpus exist. but you wont find them in your computer for a few years. becuase 32bits isnt enuf anymore.
with the 64 you can move 64 bits from and to 64 bit regesters.
Posted on 2002-07-15 12:32:25 by Qages
To me 32-bits is OK, I mean, I have just learned it... gimme a break... if i gotta go now on learnig 64bit suff... c'mon, i think it works REALLY WELL the 32 bit as its now, and AMDs have even 3DNow so... who needs 64 bits? That?s too much ;)
Posted on 2002-07-15 12:40:11 by slop
32 isnt enif for me, i want to do big projects that require large precition numbers.
Posted on 2002-07-15 12:41:44 by Qages
But see my point: 32-bits is from 0 - 4 Gigas. WOW!!! That?s a lot, I meant that?s TOO MUCH. there are number there for ALL your life... thats almost infinitum, isnt it?

So don?t you have enough with that?
Posted on 2002-07-15 12:45:01 by slop
no man 4gb is small, SMALLLL!!!!!!! when u get to be a even better programmer youll find that 32bits just isnt enugh! 64 bits is all the numbers u need, well maby 128 bits is that, i mean if you have a 20gb drive, well u need 64 bits to hold the amount of bytes u have, see how 32 bits isnt enuf!!!
Posted on 2002-07-15 13:07:00 by Qages
Qages, when do you think CPU having 48 Tb (tera bit) regs will be standard server CPUs? By 2175 is my guess, hope I'll live to know...
Posted on 2002-07-15 13:10:34 by scientica
2175 lol well all be dead by then. by 2050 there will be 15 billion humanz. imagine 1 other persion standing next to every person you see.... well id say 64 bit standard in 5-10 years.
Posted on 2002-07-15 13:48:44 by Qages