Jump to content
  • Advertisement

Archived

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

test2

hi- and lo-order bits

This topic is 5978 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

what the heck are the hi- and the lo-order bit? can someone tell me constants for a bitwise and to check them out?

Share this post


Link to post
Share on other sites
Advertisement
Normally thats like asm talk... as I''ve seen it.

Anyhoo, I don''t know to much assembler but I did come across those terms. it works like this:

A normal int is 16 bits, 2 bytes, the high order bits are numbers 15-8, while the lo order ones are bits 7-0.

15 14 13 12 11 10 09 08|07 06 05 04 03 02 01 00
--------HI------------***-----------LO---------

Not sure what you mean in your second sentace.. but I think you mean what bitmask or bitoperations you can use to extract it?

If thats what you mean
hi=(0xF0&your_int)>>8;
lo=(0x0F&your_int);
I think thats right.

Share this post


Link to post
Share on other sites
quote:
Original post by Tricron2
A normal int is 16 bits, 2 bytes

Not unless you''re using a 16 bit CPU (or a weird compiler). With a regular compiler for the x86 an integer is 32 bits. BTW: It''s properly called "assembly", not "assembler".

Share this post


Link to post
Share on other sites
And just to be technically correct, in a 16 bit integer (WORD), bits 8-15 would make up the "high order byte". The high order bit is 15. The term order refers to placement of some value relative to another. Example:

A DWORD (unsigned 32 bit int) has a high-order word and a low-order word

A WORD (unsigned 16 bit int) has a high-order byte and a low-order byte

etc... etc... It''s all relative.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!