Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[ARM] is it reasonable to learn arm assembly

Status
Not open for further replies.

reza05

Junior Member level 2
Joined
May 31, 2015
Messages
21
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
152
Hello,
I writing avr and pic codes by assembly.
Todays I trying to learn arm with assembly language
Is it reasonable to learn arm by assembly?
I don't know what source I need to start.
Please recommend me a good source to learning how to write code in stm32 cortex-m3 by assembly.
Thanks
 

Hello!

I don't think there can be any definite reply to that kind of question. But I think it doesn't
make much sense today to program in assembly.
- There is absolutely nothing that you can do in assembly and cannot do in C
- Today's compilers are so optimized that it becomes always more difficult to compete with
a compiler when it's time to generate your code.
- Assembly is not portable. At least less portable than C.

My approach would be as follows:
- Write everything in C / C++
- When you want to really improve a highly repetitive routine, then compile it, open a disassembler
window and check what it does. At this point, in case you want to improve a particular section,
you can copy the assembler code, replace your C code with the _asm() routine, and modify the
texte in the asm routine.
NB: I don't do it often, so I'm not sure of the _asm() syntax.

Dora
 
  • Like
Reactions: reza05

    reza05

    Points: 2
    Helpful Answer Positive Rating
ARM is RTOS oriented architecture. How do you planning to use RTOS together with ASM? Forget about anything you know about PIC/AVR. It is completly another level.
 
  • Like
Reactions: reza05

    reza05

    Points: 2
    Helpful Answer Positive Rating
Is it reasonable to learn arm by assembly?

If the purpose is to have the first contact with the architectures and their built-in peripherals by doing quite simple tasks, it is always valuable coding in assembly, but only that. There you can feel how the things works in the hardware level, although if you are already experienced with other simple cores you have already some perception on that. However, to make, let’s say, a professional code, there are a lot of reasons to avoid doing it in assembly language, as pointed above.
 
  • Like
Reactions: reza05

    reza05

    Points: 2
    Helpful Answer Positive Rating
Thanks all,
I decided to start with IAR
but my problem is registers.
I have read some datasheet,but they are general,for example for cortex m3.
I want to know all stm32f103ret6 registers and other document just about this microcontroller
Could you please introduce me related datasheet
 

but my problem is registers.
I have read some datasheet,but they are general,for example for cortex m3.

Are you sayning you didn't find enough information about registers on datasheet of the specific part you intend to use ?
 

Exactly yes
 

Did you really read all their related documentation ( datasheet/ programming manual/ etc... ) ?
There you can find a lot of information covered in details.
 

I decided to start with IAR
but my problem is registers.
If you are using IAR and ST, you can download all the examples for your MCU (or similar one). Go to menu Help -> Information Center -> Example Projects -> ST. There a message will be shown to download the content from ST. You will be suprised with how many examples are there in IAR. Practically you can operate almost all the MCU peripherals by copying code from those examples. ST's standard peripheral libray along with the examples, will help you a lot to get started.
 
  • Like
Reactions: reza05

    reza05

    Points: 2
    Helpful Answer Positive Rating
I disagree that assembly language programming is not useful/important for ARM architecture.
If you are only writing higher level applications, then you obviously don't need it.
But, if you are writing code that must be highly reliable/fault recoverable and have to write exception handlers, not all the register-related stuff for decoding the fault type, prog conter, mode and exception decoding can be done readily done in C.
If you are going to be an embedded programmer, you really do need to dive into assembly from time to time.
Though, it is MUCH less often necessary than it used to be.
 
  • Like
Reactions: FvM

    FvM

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top