Since I am mainly in the "hobbyist" class, I am not concerned about the time
it takes to write a program. I'm more concerned about program efficiency
when it's actually runing in the microcontroller.
I write in assembler because the programs come out much smaller and faster
than when written in C. Considering I'm often trying to load a program into
a device with limited flash memory anyway, this is important. I did try
writing some of the programs I'd already written in assembler in C and found
the C compiler generated code that was as much as one and a half times the
size of the assembler code. Lots of redundundundancy.
Plus, you get to learn to "think" like the particular microcontroller when
you write in its assembler. And you sometimes learn little tricks and
shortcuts that make the code even smaller and faster.
Just my tuppence worth.
Zack
On 1/15/09, brewski922 <Brewskister@gmail.com> wrote:
>
> Ditto Dave.
> I am sure most C devoties would argue that to get down and dirty or
> write the smallest and/or fast code assemble is the way to go.
>
> And most assemble folks would say to get the program completed in the
> least amount time and/or most cost effective do it in C.
>
> So both of them have their strong and weak points. When it comes down
> to billable income to meet overhead and/or payroll C is still your
> best bit. For hobbiest, like myself, I can go either way...
>
> My son works for a major US newspaper doing their web pages. For him
> you have to get the story out fast. Twenty minutes or less is good,
> all day is bad. He doesn't care that his employees uses a PC or Mac,
> nor what programming software. They just need to know how to use it.
>
> Mike
>
> >
> > Hi Brian,
> >
> > On Wed, Jan 14, 2009 at 7:45 PM, Brian <blue_eagle74@...> wrote:
> > > When I started in AVR's I used ASM then I learned C and found it
> much
> > > easier, faster, powerful.
> > >
> > > What do you like most? Why would someone like ASM over C? C is so
> much
> > > easier I think.
> > >
> > > I ask this because I hear people that like to program in ASM and I
> > > don't know why.
> >
> > I like C because I can write code that works the same on AVR, ARM,
> PC,
> > whatever. I still dabble in assembler when its needed, but I work
> with
> > too many different processors to keep all of the different assembly
> > languages straight in my head. Maybe this is just a sign of old
> age...
> >
> > I've been using C for over 20 years, and I've probably used it on
> over
> > a dozen different architectures. I've probably handcoded assembly
> code
> > for all of those platforms too.
> >
> > For people who are willing to put in the effort, you can get tighter
> > faster code by developing everything in assembler. Although on some
> > architectures the compiler will often do a much better job, unless
> > you're really really good at the assembler stuff. This is especially
> > true with the more advanced processors which have big pipelines, and
> > parallel execution units, etc.
> >
> > Personally, I don't think C is better than assembler, nor do I think
> > that assembler is better than C. They're different. They have
> > different advantages and disadvantages. You have to make the trade
> > offs and decide which one is best for you and your particular
> > application.
> >
> > --
> > Dave Hylands
> > Shuswap, BC, Canada
> > http://www.DaveHylands.com/ <http://www.davehylands.com/>
> >
>
>
>
[Non-text portions of this message have been removed]