• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
llvm-gcc and clang's assembly language
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

llvm-gcc and clang's assembly language


  • Subject: llvm-gcc and clang's assembly language
  • From: Ashi <email@hidden>
  • Date: Thu, 07 Feb 2013 18:40:13 +0800

Hi, all,
I've a project which have assembly code for ARM cpu, which is written under GNU as' syntax. I find my code can't be compiled by Xcode, neither llvm-gcc or clang. I've searched, find only few information about llvm-gcc and clang's assembler's syntax. I only find a doc about OS X assembler(https://developer.apple.com/library/mac/#documentation/DeveloperTools/Reference/Assembler/000-Introduction/introduction.html), but it's a little old(2009), and seems only work for i386 and powerPC's assembly. I know llvm-gcc would call extern assembler and clang has an integrated assembler. But find no doc about external as, however, recently clang's release note(http://llvm.org/releases/3.2/docs/ReleaseNotes.html) says its integrated-as supports UAL assembly. So I wrote a test which follows UAL(I refereed ARM Compiler toolchain's doc, which is UAL syntax), and can be compiled by armasm(ARM complier toolchain's assembler), but clang failed to compile it.

here is my code in UAL:
  1        ; this code follows's armasm's syntax                                                                                                                                                             
 2        ; comment test                                                                                                                                                                                    
 3                                                                                                                                                                                                          
 4        area    armasm_test, code, readonly                                                                                                                                                               
 5        export  add_gas         ; GLOBAL is a synonym for EXPORT.                                                                                                                                         
 6        align   4                                                                                                                                                                                         
 7        ; MESSAGE DCB "Hello World!",0 ;comments test                                                                                                                                                     
 8        ; COUNT EQU 4                                                                                                                                                                                     
 9                                                                                                                                                                                                          
10add_gas                                                                                                                                                                                                   
11        ; add src1 and src2, result is return to dst                                                                                                                                                      
12        ; r0: *dst                                                                                                                                                                                        
13        ; r1: *src1                                                                                                                                                                                       
14        ; r2: *src2                                                                                                                                                                                       
15                                                                                                                                                                                                          
16        push    {r4, r5}                                                                                                                                                                                  
17        ldr     r3, [r1]                                                                                                                                                                                  
18        ldr     r4, [r2]                                                                                                                                                                                  
19        add     r5, r3, r4                                                                                                                                                                                
20        str     r5, [r0]                                                                                                                                                                                  
21        pop     {r4, r5}                                                                                                                                                                                  
22        bx      lr          


Thanks for any help!
ashi
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: llvm-gcc and clang's assembly language
      • From: Jim Grosbach <email@hidden>
  • Prev by Date: Re: What happened to the option to not copy coloring and styling from the editor?
  • Next by Date: Re: llvm-gcc and clang's assembly language
  • Previous by thread: Re: Indexing Forever
  • Next by thread: Re: llvm-gcc and clang's assembly language
  • Index(es):
    • Date
    • Thread