How can I change only the higher bit of byte in masm32? Assume I have 00101111
byte and want to get 10101111
.
Asked
Active
Viewed 27 times
0
-
4Use `or` if you want to set the bit, or `xor` if you want to invert it. – Michael Mar 24 '20 at 14:33
-
@Michael, I want to set the bit. Could you provide more detailed explanation, please? – joeyave Mar 24 '20 at 14:54
-
`or al, 80h` or something like that should suffice. You really should read up on [bitwise operations](https://en.wikipedia.org/wiki/Bitwise_operation) since they are very commonly used in assembly code. – Michael Mar 24 '20 at 15:17
-
@Michael, oh, I see. Thank you! – joeyave Mar 24 '20 at 15:21
-
x86 has an instructions for each of the C bitwise operators so IMO this is a duplicate. – Peter Cordes Mar 25 '20 at 00:41