Visit Jeremy's Blog.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 09-11-2006, 01:53 PM   #1
Registered: May 2005
Location: PA
Distribution: Ubuntu
Posts: 204

Rep: Reputation: 30
Exclamation assembly language: ret>>=10


what does this mean?

ret <<= 10

does it mean shift left the 10th bit of ret?
ret is an unsigned long variable in the memparse function in the linux/lib/cmdline.c file.

Old 09-13-2006, 12:22 AM   #2
Wim Sturkenboom
Senior Member
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
First, this is not assembly.

It means shift the content of ret 10 positions to the left and place it back in ret. Shifting left actually is multiplying by 2 (in this case 10 times resulting in multiplying by 2^10 (which equals 1024)). So if ret contained 1, it now contains 1024.
Similarly, shifting right is the same as dividing by 2.

There is a programming section here on LQ which might be a better place for programming related questions. Just for the next time that you have a similar question.
Old 09-13-2006, 04:11 AM   #3
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Moved: This thread is more suitable in <Programming> and has been moved accordingly to help your thread/question get the exposure it deserves.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
assembly language in linux herbertgnanaraja Programming 12 09-21-2006 03:52 AM
assembly language directives ashlesha Programming 2 07-03-2006 09:20 PM
Assembly Language syntax ashlesha Linux - Newbie 4 06-30-2006 04:22 PM
Assembly Language, and networks grizzly Programming 5 12-11-2003 09:50 PM
SPARC assembly language jclark00001 Programming 3 02-26-2003 08:52 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:17 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration