i recently started learning c++ and assembly and i came across LOBYTE when i disassembled something in IDA and viewed the function in pseudo code.
Reading the msdn : http://msdn.microsoft.com/en-us/library/windows/desktop/ms632658(v=vs.85).aspx
i still dont understand.What is a low order byte? Can someone tell me more on what its used for and an example of its usage in c++ ?
LOBYTE
and HIBYTE
along with HIWORD
and LOWORD
, are macros used to extract a word or a byte from a larger set of bytes/words.
As an example, say you have the two bytes 24 FF
, which make a word. You have this value stored in a unsigned short ushortvar
in your program. Now you can extract either of the two bytes by using HIBYTE(ushortvar)
or LOBYTE(ushortvar)
. The first will be equal to 0x24
, and the latter will be equal to 0xff
. You can do the same with a unsigned int
to extract a one of the words by using LOWORD
respectively HIWORD
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With