What is LOBYTE in C++
byte, c++
Solution
`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`.
Problem
I recently started learning C++ and assembly. I came across `LOBYTE` when I disassembled something in IDA and viewed the function in pseudo code. After reading the documentation at MSDN, I still don't understand. What is a low order byte? Can someone tell me more on what it's used for and an example of its usage in C++?