Archived

This topic is now archived and is closed to further replies.

qword, instead of __int64

This topic is 5335 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am reading an assembly programming book, and I just knew that in addition to dword, there is qword (quad word). word is 2 bytes, and is commonly associated with short. dword is 4 bytes, associated with long. qword is 8 bytes, but I never see it as a data type?

Share this post


Link to post
Share on other sites
word/dword/qword are ASM datatypes. They are not officially defined in the C/C++ standard (the fact that MS uses them in the windows header files is another thing). QWORD is the ASM counterpart of __int64, and is commonly used in FPU code. You can always typedef qword to __int64, if you want.


[edited by - Yann L on May 7, 2003 2:09:43 PM]

Share this post


Link to post
Share on other sites
QWORD isn''t used very much for two reasons.
1. You generaly don''t need a variable that large
2. Most of todays processors are 32bit NOT 64bit so QWORDs aren''t directly supported which makes them alot slower than using standard DWORDs

Share this post


Link to post
Share on other sites
Also, I''ll bet if you want to use them (like simply printing one out) you''d have to write your own printing method.

Is there an already-written output function which accepts int64?

Share this post


Link to post
Share on other sites
Again: WORD/DWORD & co. are not C/C++ types. They are ASM types, and QWORD is commonly used in ASM code. Microsoft happened to use those ASM types in C/C++, but that's about all. They could also have named them MS_short, MS_int, or Bill_Gates_int64. It was just a convenience typedef, to get machine independent types (there were DEC Alpha + MIPS versions of Win NT, not only x86).

quote:

Is there an already-written output function which accepts int64?


Uh, printf() or iostream ?


[edited by - Yann L on May 7, 2003 7:33:59 PM]

Share this post


Link to post
Share on other sites