From: Lax on

Are there any situations where programming an embedded processor
"requires" at least some assembly code?

How about for AVR, MSP430, 68HC11, 8051(Atmel)?
Can these 4 microcontrollers be programmed fully in C without touching
assembly (even interrupts and etc.)?
From: Pertti Kellomäki on
Lax wrote:
> How about for AVR, MSP430, 68HC11, 8051(Atmel)?
> Can these 4 microcontrollers be programmed fully in C without touching
> assembly (even interrupts and etc.)?

At least for AVR one can write pretty much everything using
gcc and avr-libc. However, while writing "cli();" in your C program
is not technically "touching assembly", it is not much different
from including the cli instruction as inline assembly. It is more
convenient, but still very much target dependent.
--
Pertti
From: Piotr on
Lax pisze:
> How about for AVR, MSP430, 68HC11, 8051(Atmel)?
> Can these 4 microcontrollers be programmed fully in C without touching
> assembly (even interrupts and etc.)?

IMO, generally it is possible, but sometimes C compiler doesn't
optimalize code such good as you want. In this case you can write it in
assembly language or change your approach to the problem.

--
Piotr Piwko
http://www.embedded-engineering.pl/
From: Vladimir Vassilevsky on


Lax wrote:

> Are there any situations where programming an embedded processor
> "requires" at least some assembly code?
>
> How about for AVR, MSP430, 68HC11, 8051(Atmel)?
> Can these 4 microcontrollers be programmed fully in C without touching
> assembly (even interrupts and etc.)?

You have to resort to assembly in the two special cases:

1. The system level work like switching the contexts of the tasks, C
startup code, etc.

2. The parts of code where the performance is very critical.

Other then that, everything can be done in C.


Vladimir Vassilevsky
DSP and Mixed Signal Design Consultant
http://www.abvolt.com
From: hectorhg on
I think that it should be possible, although as it has been said, C
compiler may not optimize your code properly, and you may have some lost of
performance. You may try the asm directive of C as a solution to avoid
writing a whole file in assembly code.

Good Luck!

>
>Are there any situations where programming an embedded processor
>"requires" at least some assembly code?
>
>How about for AVR, MSP430, 68HC11, 8051(Atmel)?
>Can these 4 microcontrollers be programmed fully in C without touching
>assembly (even interrupts and etc.)?
>