位(bit)操作技巧 – 5

7.

Q:  如何合并字节为字
A:  MSB 先移 8 位,然后 “位或” (OR) LSB

Word(HiByte) << 8;
Word(HiByte) | Word(LoByte);

 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.