Skip Navigation Links | |
Exit Print View | |
SPARC Assembly Language Reference Manual Oracle Solaris 11 Express 11/10 |
1. SPARC Assembler for SunOS 5.x
3. Executable and Linking Format
4. Converting Files to the New Format
B. Examples of Pseudo-Operations
C. Using the Assembler Command Line
The pseudo-ops shown in this example are .align, .global, .type, and .size.
The following C subroutine:
int sum(a, b) int a, b; { return(a + b); }
can be translated into the following assembly code:
.section ".text" .global sum .align 4 sum: retl add %o0,%o1,%o0 ! (a + b) is done in the ! delay slot of retl .type sum,#function ! sum is of type function .size sum,.-sum ! size of sum is the diff ! of current location ! counter and the initial ! definition of sum