LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices

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

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


Hi,

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.

thanks,
ashlesha.
 
Old 09-13-2006, 01: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, 05:11 AM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,000
Blog Entries: 11

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


Reply


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 04:52 AM
assembly language directives ashlesha Programming 2 07-03-2006 10:20 PM
Assembly Language syntax ashlesha Linux - Newbie 4 06-30-2006 05:22 PM
Assembly Language, and networks grizzly Programming 5 12-11-2003 10:50 PM
SPARC assembly language jclark00001 Programming 3 02-26-2003 09:52 PM


All times are GMT -5. The time now is 09:12 PM.

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