• 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
Re: llvm-gcc and clang's assembly language
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: llvm-gcc and clang's assembly language


  • Subject: Re: llvm-gcc and clang's assembly language
  • From: Ashi <email@hidden>
  • Date: Fri, 08 Feb 2013 16:19:23 +0800

Thanks, Jim.
but is there any doc for iOS assembler? The doc I found before(https://developer.apple.com/library/mac/#documentation/DeveloperTools/Reference/Assembler/000-Introduction/introduction.html
) only includes information about i386 and PowerPC, doesn't have any thing about ARM.

And I'm also wondering is it possible that compile my code by Clang or llvm-gcc(call the external as) for iOS without modifying the code( the code is written in GNU as syntax).

Thanks!
Ashi


On Fri, Feb 8, 2013 at 2:17 AM, Jim Grosbach <email@hidden> wrote:
Hi Ashi,

clang's integrated assembler uses the Unified Syntax for instructions, but still uses the same assembler directives as the 'as' from cctools. 

-Jim


On Feb 7, 2013, at 2:40 AM, Ashi <email@hidden> wrote:

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)

This email sent to email@hidden


 _______________________________________________
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

References: 
 >llvm-gcc and clang's assembly language (From: Ashi <email@hidden>)
 >Re: llvm-gcc and clang's assembly language (From: Jim Grosbach <email@hidden>)

  • Prev by Date: Getting code completion to work for external build project?
  • Next by Date: Hard clang crash in Xcode 4.6
  • Previous by thread: Re: llvm-gcc and clang's assembly language
  • Next by thread: 10.8 man pages?
  • Index(es):
    • Date
    • Thread