Fog Creek Software
Discussion Board




Getting the value of the lower and higher byte?

What should I do to get the value of the lower byte of a word; let's say 32 bytes? The higher byte?
(32 bytes per word for Intel PC?)
Thanks.

Sheila
Thursday, August 26, 2004

byte mask and byte shift

Ankur
Thursday, August 26, 2004

#define HIWORD(l)          ((WORD)(((DWORD)(l) >> 16) & 0xFFFF))
#define LOBYTE(w)          ((BYTE)(w))
#define HIBYTE(w)          ((BYTE)(((WORD)(w) >> 8) & 0xFF))

btw:
it's part of windef.h

redguardtoo
Thursday, August 26, 2004

#include <windows.h>

DWORD val32bits = 0x1F2F3F4F;

WORD hiWord = HIWORD( val32bits );
WORD loWord  = LOWORD( val32bits );

BYTE hiByteHiWord = HIBYTE( hiWord );
BYTE loByteHiWord = LOBYTE( hiWord );

BYTE hiByteLoWord = HIBYTE( loWord );
BYTE loByteLoWord = LOBYTE( loWord );

Heston
Thursday, August 26, 2004

Oh wait I get it.

If someone posts an idiotic question under a male name, they get flamed by the general population of the board with "learn the basics" or google query posts, but

as long as you post under a female name, you are assisted with just about any stupid thing imaginable.

You gentlemen have been trolled, methinks.

muppet
Thursday, August 26, 2004

Hey Muppet you mean like this one? http://discuss.fogcreek.com/joelonsoftware/default.asp?cmd=show&ixPost=179831&ixReplies=13

By the way check the name of the OP. Looks like female to me.

Matthew Lock
Thursday, August 26, 2004

LOL ... I'm laughing like crazy :-D

Pythonic
Friday, August 27, 2004

For once I agree with muppet. :-P

.
Friday, August 27, 2004

I once had fight with Muppet, fine enough.
But why are you people so much against him!?
He is not perfect, accept him as he is. Simple!

I am tired...
Friday, August 27, 2004

Bordem, he's an easy target, he makes such a fool of himself etc.

Matthew Lock
Friday, August 27, 2004

No, see, Matthew, that was a valid question.  A very specialized area of interest with luke warm Google results makes an excellent question to shop around to various professional forums.  You were just being a dick.

"How do I do debug", now that's an assinine question.

muppet
Friday, August 27, 2004

------Bordem, he's an easy target----

Great, He is an easy target, so keep on bashing him on each thread. Whether he is right or wrong. Just because he is muppet keep on insulting him. You all have every right to do that.

----- he makes such a fool of himself etc. -----

No, he doesn't. 
From the past three weeks I have seen many more bigger fools here.

And believe me their are many anonymous persons posting by his name, atleast give him the benifit of doubt!

This forum was far more constructive and productive around 3 weeks back, but now it is turning out to be a garbage. With people who think that they are the most intelligent and wise people out here and have every right to make other's feel inferior. And give damn about other's feelings and sentiments.

I know muppet sometimes does the same, and so are you all.   

I am tired...
Friday, August 27, 2004

"No, see, Matthew, that was a valid question.  A very specialized area of interest with luke warm Google results makes an excellent question to shop around to various professional forums.  You were just being a dick."

While I disagree with the anti-muppet movement. I do thing that there is no invalid/idiotic question in any forum (i.e. not all people in a forum will say, hey what a stupid question!  ). Muppet (and Matthew), if you think a question is too idiotic to be answered... just do not reply, let the others reply.  As you have seen, there are people here that do not consider this thread stupid.

The quality of this forum is threatened everytime people judge others' posts.

TheFBIgaveMeANewIdentity
Friday, August 27, 2004

The reason why many anonymouse people impersonated muppet is precisely that he used to behave in highly intolerant and opinionated fashion. The enfant terrible, you know? No matter what  question was asked or what statement was made, muppet would find a way to say the equivalent "if you say that, you suck, ha ha". In addition, he used to brag a lot at how well-off and accomplished and proud of himself he was.

Very soon, people began to be annoyed. Impersonation was just a method of toning muppet down unique to this board. He was "diluted". His identity of the enfant terrible was hijacked. Now when he tries his "you suck" trick, half a dozen muppets begin to say outrageous things on his behalf.

Net result? No one takes muppet seriously. He's become the stock clown pseudonym - all adverse effects without the fun of actually being the clown!

And serves him right.

Note, though, that in the past couple of weeks he did tone down a lot. Not hopeless, our muppet?

.
Friday, August 27, 2004

"...our muppet"

If you want to claim him for yourself, fine, but don't lump us all into it. 

A friend of muppet is no friend of mine
Friday, August 27, 2004


FORGIVE and FORGET!
Make this earth and forum a better place.

:-)

I am not static..I change..so does this!
Friday, August 27, 2004

I find it suspicious that the poster's name is Sheila. This is Austrailian slang for woman. So Sheila is a synonym for 'Aussie Chick'.

Dutch "muppet" Boyd
Friday, August 27, 2004

I would like to push my glasses up my nose and point to "32 bytes per word" as evidence of a troll.

I mean, what the fuck people!

Alex
Friday, August 27, 2004

.  -

interesting theory.  You must be one of the idiots impersonating me, eh?  I'm afraid, though, that your efforts aren't what kept me from the forum.  There was just a severe lack of anything interesting to comment on for a week or two.

muppet
Friday, August 27, 2004

This lame forum has no interesting posts for such a sophisticated guy like me! And you all are too wimpy to say anything without impersonating me!

muppet
Saturday, August 28, 2004

I take my claim that muppet might have understood something back. Sorry, people.

Someone less self-infatuated might, but not in this case, I suppose.

muppet
Saturday, August 28, 2004

*  Recent Topics

*  Fog Creek Home