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 articleAssembly: Division
Next articleAssembly: Bit Rotating
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -

Most Popular

Recent Comments

Cleveland Furia on How to Clear Google Activity
Sid Wohlfarth on How to Clear Google Activity
Riley Magsayo on How to Clear Google Activity
สมัครรับเครดิตฟรี ทันที on How to improve Remote Desktop Protocol Performance
Neal Wangstad on How to Clear Google Activity
Slavcho Andov on How to install Ubuntu
Slavcho Andov on How to fix bad sectors
Sheraz Ali on How to Backup Android