LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 06-30-2006, 01:36 PM   #1
ashlesha
Member
 
Registered: May 2005
Location: PA
Distribution: Ubuntu
Posts: 204

Rep: Reputation: 30
Exclamation Assembly Language syntax


hi,

can you point me to an online guide/ a quick reference bk on assembly language syntax..i m trying to understand kernel code written for a MIPS board..

it would be great help if you could tell me what the following instructions mean:

.set
li
.fill


thank you,
ashlesha.
 
Old 06-30-2006, 02:46 PM   #2
Theorist
Member
 
Registered: Jun 2006
Distribution: FC5, FC3, RHEL 3, Debian 3.1, Debian 3.0
Posts: 56

Rep: Reputation: 15
For gas

Hi ashlesha,
Assembler directives begin with a period. So .set and .fill are assembler directives. The following is as per the GNU Assembler : -

.set
Quote:
Syntax - .set symbol, expression
Change the value of symbol to expression

.fill
Quote:
Syntax - .fill repeat , size , value
Creates repeat number of copies of size number of bytes

li
Quote:
Syntax - li destination, expression
Load immediate expression to destination

Refer the following : -
http://www.gnu.org/software/binutils...l_mono/as.html

http://www.dimi.uniud.it/pietro/MIPS..._Lang_Vol2.pdf

With Regards,
Theorist
 
Old 06-30-2006, 02:48 PM   #3
ashlesha
Member
 
Registered: May 2005
Location: PA
Distribution: Ubuntu
Posts: 204

Original Poster
Rep: Reputation: 30
Thanks man-- great help..

ashlesha.
 
Old 06-30-2006, 04:51 PM   #4
ashlesha
Member
 
Registered: May 2005
Location: PA
Distribution: Ubuntu
Posts: 204

Original Poster
Rep: Reputation: 30
i have another question:

Quote:
.align abs-expr, abs-expr, abs-expr

Pad the location counter (in the current subsection) to a particular storage boundary. The first expression (which must be absolute) is the alignment required, as described below.

The second expression (also absolute) gives the fill value to be stored in the padding bytes. It (and the comma) may be omitted. If it is omitted, the padding bytes are normally zero. However, on some systems, if the section is marked as containing code and the fill value is omitted, the space is filled with no-op instructions.

The third expression is also absolute, and is also optional. If it is present, it is the maximum number of bytes that should be skipped by this alignment directive. If doing the alignment would require skipping more bytes than the specified maximum, then the alignment is not done at all. You can omit the fill value (the second argument) entirely by simply using two commas after the required alignment; this can be useful if you want the alignment to be filled with no-op instructions when appropriate.

The way the required alignment is specified varies from system to system. For the a29k, hppa, m68k, m88k, w65, sparc, and Hitachi SH, and i386 using ELF format, the first expression is the alignment request in bytes. For example `.align 8' advances the location counter until it is a multiple of 8. If the location counter is already a multiple of 8, no change is needed.

For other systems, including the i386 using a.out format, it is the number of low-order zero bits the location counter must have after advancement. For example `.align 3' advances the location counter until it a multiple of 8. If the location counter is already a multiple of 8, no change is needed.

This inconsistency is due to the different behaviors of the various native assemblers for these systems which GAS must emulate. GAS also provides .balign and .p2align directives, described later, which have a consistent behavior across all architectures (but are specific to GAS).
what i dont understand is what will the " .align 2 " instruction accomplish?
 
Old 06-30-2006, 05:22 PM   #5
ashlesha
Member
 
Registered: May 2005
Location: PA
Distribution: Ubuntu
Posts: 204

Original Poster
Rep: Reputation: 30
what does the .ent & .frame do??

thanks,
ashlesha

Last edited by ashlesha; 06-30-2006 at 05:24 PM.
 
  


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
Printing to screen using AT&T assembly syntax doron_bl Programming 2 08-30-2005 02:00 AM
Assembly Language on 64 Bit systems Sleevy Programming 1 09-06-2004 02:58 AM
Assembly Language, and networks grizzly Programming 5 12-11-2003 10:50 PM
Assembly syntax jinksys Programming 1 09-01-2003 06:07 PM
SPARC assembly language jclark00001 Programming 3 02-26-2003 09:52 PM


All times are GMT -5. The time now is 01:51 PM.

Main Menu
Advertisement
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