Author | Message | Time |
---|---|---|
JoeTheOdd | Poke. I got bored, so I decided to write up a document on data types. Yeah, its rather dry, but I wanted to get it across with no nonsence. If you want to spice it up a bit, feel free to do so. I have a codeheader and code style in my stylesheet, so you can add code blocks if you want (see test.html for example). If you'd like to host a copy on your server, do something like this. [code]cd ~/public_html mkdir datatypes wget http://www.javaop.com/~joe/datatypes/index.html wget http://www.javaop.com/~joe/datatypes/test.html wget http://www.javaop.com/~joe/datatypes/stylesheet.css[/code] | August 25, 2005, 4:47 AM |
Yegg | You should include Half-word and QuadWord. According to answers.com these are actual Word forms. I think by their name you will know what their value is to be. | August 25, 2005, 3:01 PM |
Arta | nybble* What about strings? | August 25, 2005, 3:43 PM |
R.a.B.B.i.T | Obviously strings are a series of bytes. Silly Arta ^^ | August 25, 2005, 4:49 PM |
Myndfyr | [quote author=rabbit link=topic=12613.msg125410#msg125410 date=1124988550] Obviously strings are a series of bytes. Silly Arta ^^ [/quote] Yeah, but different types of strings are different kinds of sequences of bytes. :P | August 25, 2005, 4:49 PM |
kamakazie | From the document: [quote] The Nibble I am not aware of a nibble being used in Battle.net programming, but for completeness I will discuss it here. A nibble is four bits, half a byte. The biggest nibble is 2^4, or 16. [/quote] The large value of a nibble (nybble, however you want to spell it) is 15, not 16. There are, however, 16 possible values for a nibble. [quote] The Byte The byte is a single character, 8 bits. Any character is a single byte. The biggest byte possible is 2^8, or 256. [/quote] Same as above. The largest value of a byte is 255. There are 256 possible values though. It is not always true that any character is a single byte. That highly depends upon the type of encoding used, unless you're talking about 7-bit ASCII which should be noted then. Actually, as I look more and more through the document, a lot of the information is wrong about sizes of datatypes. | August 25, 2005, 5:31 PM |
Myndfyr | Generally, the largest value of data is 2[sup]number-of-bits[/sup] - 1 [edit]Corrected the rather egregious error. Thanks, Arta![/edit] | August 25, 2005, 6:40 PM |
Arta | 2[sup]number-of-bits[/sup]-1, you mean :) | August 25, 2005, 7:08 PM |
JoeTheOdd | Thanks everyone. Its been fixed and you've all been credited. Yegg, I have no experience with a HWORD. I'll look it up later. Seems as if it would be no different than a byte. | August 25, 2005, 8:47 PM |
kamakazie | [quote author=Joe[x86] link=topic=12613.msg125433#msg125433 date=1125002871] Thanks everyone. Its been fixed and you've all been credited. Yegg, I have no experience with a HWORD. I'll look it up later. Seems as if it would be no different than a byte. [/quote] The size of your WORD and DWORDS are still wrong. The number of values they can represent are be 2^16 and 2^32, respectively. Subtract one to get the maximum value they can present (if they're unsigned, that is). | August 25, 2005, 9:07 PM |
R.a.B.B.i.T | Byte booleans aren't seen in the BNCS protocol, and WORD booleans aren't either, only DWORD Booleans are (at least by the common BotDev definitions, where the sizes are all wrong). A more accurate term for "DWORD Boolean" would be "32-Bit Boolean", however. Nybble is in there for no reason; it is not used by the BNCS protocol nor by any future definition you present. A more accurate list: Unsigned Byte: 7 (ANSI) or 8 (ASCII) bits; value range from 0 - 255 inclusive HWORD: One half of the WORD-size of the CPU; on a 32-bit system a HWORD is 2 bytes, and on a 64-bit system a HWORD is 4 bytes. WORD: The standard data size of the CPU; on a 32-bit system a WORD is 4 bytes, and on a 64-bit system a WORD is 8 bytes. 32-Bit Boolean: A 32-bit represenation of 0 or 1. DWORD: Double the WORD-size of the CPU; on a 32-bit system a DWORD is 8 bytes, and on a 64-bit system a DWORD is 16 bytes. QWORD: Quadruple the WORD-size of the CPU; on a 32-bit system a QWORD is 16 bytes, and on a 64-bit system it is 64 bytes. I still say Arta and his crew need to update BnetDocs with the correct information. | August 25, 2005, 9:26 PM |
Arta | I've never heard 'HWORD' before. That looks like a SHORT to me. | August 25, 2005, 9:51 PM |
Newby | Nor have I. I have heard of QWORDS, though. | August 25, 2005, 9:56 PM |
iago | [quote author=dxoigmn link=topic=12613.msg125436#msg125436 date=1125004064] [quote author=Joe[x86] link=topic=12613.msg125433#msg125433 date=1125002871] Thanks everyone. Its been fixed and you've all been credited. Yegg, I have no experience with a HWORD. I'll look it up later. Seems as if it would be no different than a byte. [/quote] The size of your WORD and DWORDS are still wrong. The number of values they can represent are be 2^16 and 2^32, respectively. Subtract one to get the maximum value they can present (if they're unsigned, that is). [/quote] The above is correct [quote]A WORD is not always the same size on all systems, but for the purpose of Battle.net bot development, we will consider it to always be 16 bits, or two bytes. A WORD can be up to 255^2, and coresponds with the BASIC data type Integer, and the C data type short.[/quote] A word can be up to 256[sup]2[/sup]-1, or 65525. It has 256[sup]2[/sup], or 65536 possible values. You'd be better off using the 2[sup]x[/sup] notation. | August 25, 2005, 10:18 PM |
kamakazie | [quote author=Newby link=topic=12613.msg125446#msg125446 date=1125006997] Nor have I. I have heard of QWORDS, though. [/quote] QWORDS are quad-words, 64-bits typically. Pertaining to Battle.net, the only place I have seen them used was for a character's experience in Diablo II. | August 25, 2005, 10:32 PM |
iago | [quote author=dxoigmn link=topic=12613.msg125456#msg125456 date=1125009125] [quote author=Newby link=topic=12613.msg125446#msg125446 date=1125006997] Nor have I. I have heard of QWORDS, though. [/quote] QWORDS are quad-words, 64-bits typically. Pertaining to Battle.net, the only place I have seen them used was for a character's experience in Diablo II. [/quote] Technically, FILETIME is a QWORD. | August 25, 2005, 10:33 PM |
Myndfyr | [quote author=iago link=topic=12613.msg125457#msg125457 date=1125009196] [quote author=dxoigmn link=topic=12613.msg125456#msg125456 date=1125009125] [quote author=Newby link=topic=12613.msg125446#msg125446 date=1125006997] Nor have I. I have heard of QWORDS, though. [/quote] QWORDS are quad-words, 64-bits typically. Pertaining to Battle.net, the only place I have seen them used was for a character's experience in Diablo II. [/quote] Technically, FILETIME is a QWORD. [/quote] And they are also used in Warcraft III profiles to indicate last-game-played-time. | August 25, 2005, 11:05 PM |
Newby | [quote author=dxoigmn link=topic=12613.msg125456#msg125456 date=1125009125] [quote author=Newby link=topic=12613.msg125446#msg125446 date=1125006997] Nor have I. I have heard of QWORDS, though. [/quote] QWORDS are quad-words, 64-bits typically. Pertaining to Battle.net, the only place I have seen them used was for a character's experience in Diablo II. [/quote] I know what they are. I had to deal with them in reversing a key generation algorithm. :) | August 25, 2005, 11:11 PM |
kamakazie | [quote author=Newby link=topic=12613.msg125470#msg125470 date=1125011479] [quote author=dxoigmn link=topic=12613.msg125456#msg125456 date=1125009125] [quote author=Newby link=topic=12613.msg125446#msg125446 date=1125006997] Nor have I. I have heard of QWORDS, though. [/quote] QWORDS are quad-words, 64-bits typically. Pertaining to Battle.net, the only place I have seen them used was for a character's experience in Diablo II. [/quote] I know what they are. I had to deal with them in reversing a key generation algorithm. :) [/quote] Haha whoops. The placement of the two 'I's made my brain merge them into one, minus the period. Still good information :P | August 26, 2005, 2:14 AM |
Newby | Yes, I did not know that the only QWORD known on Battle.net was based on experience. Though, now that I think about it, I guess I could see that happening, since experience gets huge. :P | August 26, 2005, 3:34 AM |
JoeTheOdd | Rabbit: My WORD/DWORD/QWORD size is correct, for Battle.net BotDev. Thats what this document is for. iago: Your BBCode went boom. | August 26, 2005, 11:45 AM |
iago | [quote author=MyndFyre link=topic=12613.msg125469#msg125469 date=1125011116] [quote author=iago link=topic=12613.msg125457#msg125457 date=1125009196] [quote author=dxoigmn link=topic=12613.msg125456#msg125456 date=1125009125] [quote author=Newby link=topic=12613.msg125446#msg125446 date=1125006997] Nor have I. I have heard of QWORDS, though. [/quote] QWORDS are quad-words, 64-bits typically. Pertaining to Battle.net, the only place I have seen them used was for a character's experience in Diablo II. [/quote] Technically, FILETIME is a QWORD. [/quote] And they are also used in Warcraft III profiles to indicate last-game-played-time. [/quote] Wouldn't that technically be a FILETIME? Nanoseconds since Jan 1/1970 I believe? | August 26, 2005, 1:30 PM |
hismajesty | Isn't it just seconds? | August 26, 2005, 1:52 PM |
Yegg | [quote author=iago link=topic=12613.msg125457#msg125457 date=1125009196] Wouldn't that technically be a FILETIME? Nanoseconds since Jan 1/1970 I believe? [/quote] 100-nanosecond intervals since then.[quote][/quote][quote][/quote] | August 26, 2005, 2:10 PM |
Myndfyr | [quote author=iago link=topic=12613.msg125549#msg125549 date=1125063056] Wouldn't that technically be a FILETIME? Nanoseconds since Jan 1/1970 I believe? [/quote] Yes, but as you also said: [quote author=iago link=topic=12613.msg125457#msg125457 date=1125009196] Technically, FILETIME is a QWORD. [/quote] :P | August 26, 2005, 3:51 PM |
Quarantine | I think of it as a filetime as two DWORD since a filetime is a struct with the same SIZE as a QWORD (provided the structure padding is disabled). | August 26, 2005, 4:30 PM |
LoRd | [quote author=iago link=topic=12613.msg125457#msg125457 date=1125009196] [quote author=dxoigmn link=topic=12613.msg125456#msg125456 date=1125009125] [quote author=Newby link=topic=12613.msg125446#msg125446 date=1125006997] Nor have I. I have heard of QWORDS, though. [/quote] QWORDS are quad-words, 64-bits typically. Pertaining to Battle.net, the only place I have seen them used was for a character's experience in Diablo II. [/quote] Technically, FILETIME is a QWORD. [/quote] Since the two doublewords within the FILETIME structure are not always aligned in-memory, the structure is not considered a QWORD. | August 26, 2005, 5:05 PM |
R.a.B.B.i.T | [quote author=Joe[x86] link=topic=12613.msg125539#msg125539 date=1125056742] Rabbit: My WORD/DWORD/QWORD size is correct, for Battle.net BotDev. Thats what this document is for. [/quote]No, it's not. The Battle.Net BotDev "definitions" of those terms are incorrect, so saying yours are correct as pertaining to Battle.Net BotDev means they are incorrect as well. | August 27, 2005, 2:43 AM |
Kp | [quote author=iago link=topic=12613.msg125453#msg125453 date=1125008335]A word can be up to 256[sup]2[/sup]-1, or 65525. It has 256[sup]2[/sup], or 65536 possible values.[/quote] How can it have 65536 values if its biggest value is 65525? ;) | August 27, 2005, 4:28 PM |
iago | [quote author=Kp link=topic=12613.msg125693#msg125693 date=1125160107] [quote author=iago link=topic=12613.msg125453#msg125453 date=1125008335]A word can be up to 256[sup]2[/sup]-1, or 65525. It has 256[sup]2[/sup], or 65536 possible values.[/quote] How can it have 65536 values if its biggest value is 65525? ;) [/quote] Because I hit the wrong key :-P | August 27, 2005, 7:28 PM |