Hi everyone i just wanted to know if learning assembly is really
needed and how to code other microcontrollers and microprocessors
like arduino and raspberry pi but are not arduino and raspberry pi or
in case I wanted to design my own circuit board
Hi everyone i just wanted to know if learning assembly is really
needed and how to code other microcontrollers and microprocessors
like arduino and raspberry pi but are not arduino and raspberry pi or
in case I wanted to design my own circuit board
I completely agree with John,
Michael I think you misunderstood
Assembly is always faster than c, even in avr
Binary is even faster
It is because even in a language like there is a lot of code that is not necessary for the program to function(libraries) ,
In a computer with 16GB ram and 3.6ghz processor it is not a problem but when used with a mcu with 8kb ram and 16mhz processor it has effects on speed of execution.
I completely agree with John,
Michael I think you misunderstood
Assembly is always faster than c, even in avr
Binary is even faster
It is because even in a language like there is a lot of code that is not necessary for the program to function(libraries) ,
In a computer with 16GB ram and 3.6ghz processor it is not a problem but when used with a mcu with 8kb ram and 16mhz processor it has effects on speed of execution.
@s142857, there's a not bad Wiki article about assembler which will help you to understand why assembler and binary run at the same speed.
Assembly language - Wikipedia, the free encyclopedia
Assembler (in real life) isn't always faster than C because it takes too long to write it well. In the days when there was no choice most programmers used libraries of code which meant that they were using a standard bit of code for most jobs rather than opitimising exactly for each tiny task - which is pretty much what compilers do except they don't get bored and make silly mistakes so easily.
C compilers and linkers generally do a good job of not including code which isn't used - a lot of my C code is running on processors with less than 8k of RAM. Speed and code size are not always directly related - for example it may be faster on some processors to unroll a loop and repeat the same code many times - leaving chunks of unused code in a programme is bad practice but it doesn't necessarily make it slower.
MK
Binary faster than Assembly, is kind of like saying French is faster than English (Maybe a bad analogy
)
Assembly is simply mnemonic representation of Binary to make it easier to remember the codes, even the data sheets list the code sets using the friendly mnemonic along with the HEX / Binary
It is the general use of Libraries in any language that can slow things down due to being typically written in an way to maximize use for many applications rather than one.
Assembly in of itself is no slower than the direct binary coding. except to actually write the code where the assembly can be way faster.
Peter