This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Where can I download asm(assembler) not c compiler for writing apps for I phone 6

I am interested in writing some cell phone apps in ARM assembly language. I would like to write them for Apple I phone 6  and Android Samsung S5. I am very familiar with writing in Assembly language on the IBM main frame and X86 personal computers. What learning materials are available from ARM to help me learn ARM assembly language. I also need to know the software and hardware required to assemble the apps.

Parents Reply Children
  • x There's a popular saying that "in 90% of cases, a modern compiler writes faster code than a typical Assembly programmer would". But anyone that has actually tested this theory knows how wrong this statement is! Hand-written Assembly code is ALWAYS faster and/or smaller than the equivalent compiled code, as long as the programmer understands the many intricate details of the CPU.

  • Hand-written Assembly code is ALWAYS faster and/or smaller than the equivalent compiled code, as long as the programmer understands the many intricate details of the CPU.

    In my experience well written C code is nearly always a better alternative, and if you invest time in writing C really well (i.e. the same time you would have spent writing a hand tuned assembly version) the compiler will generally beat you.

    but anyone that has actually tested this theory knows how wrong this statement is!

    If you throw "bad C" at the compiler it can't work miracles. If you write the same algorithm in C code and in assembler (i.e. write the performance critical C like you would write assembler so the compiler "knows" what you know about the assumptions it is allowed to make), in 99% of times the compiler will beat your assembler. Unless you are doing something very specialist with NEON or DSP instructions there is usually an almost 1:1 equivalence between what you can do in C and assembler - the only time the compiler generally loses is when the C version is some reference algorithm implementation, so the two are not really equivalent at all ...

    Reasons for this:

    1. There are many ARM cores and it is impossible to keep all of the micro-architectural constraints in your head. This is especially true for ARM when you have multiple possible ISA choices (ARM / Thumb) - writing Thumb assembler by hand is a painful experience.
    2. Assembler it tuned for a single architecture - you have to retune, or even re-write completely if you want to target a new ISA (e.g.. ARMv7A vs ARMv8) or microarchitecture (e.g. Cortex-A7 vs Cortex-A17). This turns into a massive time sink, and is very very expensive to maintain. With a compiler it is just changing a compile flag and hitting "recompile".
    3. The compiler generally "knows" more about your program than you do, especially if you use newer compiler features like link-time optimization and profile driven feedback to provide it even more knowledge.
    4. Even if the compiler can only get within 95% of performance, being an order of magnitude more productive in terms of development speed with a high level language and actually getting a product out of the door early means you actually stay in business. For most companies shipping product is more important than a few percent performance.

    There are of course some exceptions - I still find writing NEON code in assembler (or C intrinsics) is a far more reliable means to write vector code than letting the compiler auto-vectorize - but the number of cases where you actually need to use this is rare (media codecs and image processing for the most part).

    Pete

  • Hi, I don't say you should not use an assembler. As your question is where you can download an assembler, I only said the assembler could be called from the normal C compiler.

    Best regards,

    Yasuhiko Koumoto.