Saturday, December 14, 2024
HomeComputer programmingAssembly: Bit Shifting

Assembly: Bit Shifting

To shift bits left or right by a desired number of places, follow the example provided in the tech-recipe below.

Bit shifting is an easy task.
To shift left (in this case by eight):

shl EAX,8

To shift right (in this case by eight):

shr EAX,8

You simply provide the two operands:
1) the register to shift
2) the number of places to shift

This method will automatically fill the slots without data as 0.

Questions/Comments: [email protected]
-William. § (marvin_gohan)

Previous article
Next article
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

LATEST REVIEWS

Recent Comments

error: Content is protected !!