Re: Hey, what is all this 'off topic' posting?
- From: langwadt@xxxxxxxx
- Date: 7 Sep 2005 14:53:23 -0700
Frank Bemelman skrev:
> <langwadt@xxxxxxxx> schreef in bericht
> news:1125950137.620824.64430@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> >
> > I downloaded a demo version of cosmics 6805 compiler, compiling
> >
> > unsigned char result;
> > unsigned short a;
> > unsigned short b;
> >
> > @interrupt void _Isr(void)
> > {
> > if(a==b) result = 1;
> > else result = 0;
> > }
> >
> >
> > Produced:
> >
> > b603 lda _a+1
> > b101 cmp _b+1
> > 260b bne L52
> > be02 ldx _a
> > b300 cpx _b
> > 2605 bne L52
> > a601 lda #1
> > b704 sta _result
> > 80 rti
> > L52:
> > 3f04 clr _result
> > 80 rti
> >
> >
> > Not too bad ....
>
> Well, it sure beats the handcoded version of John ;)
>
Didn't want to rub it in, that I in all of fifteen minutes
including downloading a compiler produced code on par with the
asm posted, and that without even looking at the architecture or
instructionset on a micro I have never used and except for how to tell
the compiler it's an ISR its portable to any processor that has a
c-compiler
It will not always be like that, assembler certainly has its
place and I use it regularly, but for most of the trivial housekeeping
code it is just a waste of time and brain power....
-Lasse
.
- References:
- Hey, what is all this 'off topic' posting?
- From: Bob Monsen
- Re: Hey, what is all this 'off topic' posting?
- From: John Larkin
- Re: Hey, what is all this 'off topic' posting?
- From: Pooh Bear
- Re: Hey, what is all this 'off topic' posting?
- From: SioL
- Re: Hey, what is all this 'off topic' posting?
- From: Frank Bemelman
- Re: Hey, what is all this 'off topic' posting?
- From: Pooh Bear
- Re: Hey, what is all this 'off topic' posting?
- From: John Fields
- Re: Hey, what is all this 'off topic' posting?
- From: Pooh Bear
- Re: Hey, what is all this 'off topic' posting?
- From: John Fields
- Re: Hey, what is all this 'off topic' posting?
- From: langwadt
- Re: Hey, what is all this 'off topic' posting?
- From: Frank Bemelman
- Hey, what is all this 'off topic' posting?
- Prev by Date: Re: Bush is either a liar, or an idiot, or both.
- Next by Date: Re: pick 'n' place machines (was: OT 0805 resistor noise)
- Previous by thread: Re: Hey, what is all this 'off topic' posting?
- Next by thread: Re: Hey, what is all this 'off topic' posting?
- Index(es):
Relevant Pages
|
Loading