If I want to say for example bx is a number:
shl bx,1
shr bx,1
What will be the new bx value? Does it stay the same?
If I want to say for example bx is a number:
shl bx,1
shr bx,1
What will be the new bx value? Does it stay the same?
Copyright © 2021 Jogjafile Inc.
No (or not necessarily). The
shl bx,1will get rid of the highest bit, and theshr bx,1won't bring the old highest bit back. This means that a value like 0x8123 will become 0x0123.Mostly, it'd be almost the same as using
and bx,0x7FFFto clear the highest bit (except for the carry flag).