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: william_a_wilson@hotmail.com
-William. § (marvin_gohan)

Previous article
Next article
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -

Most Popular

Recent Comments

error: Content is protected !!