[PicForth] Festive code generation bug
Alex Holden
alex at linuxhacker.org
Wed Dec 29 18:12:46 CET 2004
easlab at absamail.co.za wrote:
> My projects are always '90% done' ;-)
I'm up to about 97% now :) Yesterday I found some code which didn't look
too complicated in the source but actually compiled to about 300
instructions. I spent an hour rewriting it and managed to reduce it to
about 100. Along with reducing the help text from a full page of text to
a three line summary and removing a complicated but non-essential
feature, I nearly have enough free space to write the last 3%.
> 'Task-handlers & floating point arithmentic' in the context of pics, seem
> to be getting absurd. You get superb bicycles, but no bicycle should be
> 'adapted' to function as a 50 passenger bus.
I would never attempt floating point on a PIC. Fixed point is bad
enough, and even multi-byte integer arithmetic can be a headache if the
language you're using doesn't have any built in support for it. I do
find the basic cooperative multitasker handy though.
> Surely 32 bit ARM is a completely different class to any pic ?
> I guess a 32 bit ARM is not appropriate for a throw-away consumer
> device like a motor-vehicle-combination-lock, which is where the
> pics shine ?
It depends on the application. Yes, with high volume low overhead stuff
it makes sense to spend a lot of time squeezing it into the cheapest
processor possible, but with very small volume projects and one-offs it
can make sense to spend a few quid extra on buying a more powerful
processor than you need because the extra resources it gives you allow
you to develop the software quicker and easier. In the past I stayed
away from ARM because they were generally big chips with external Flash
etc. which complicates the hardware design, but the Philips LPC2000
devices are small and have everything on-chip. Of course the downside is
that you're tempted to use the extra resources to implement lots of
extra features ;)
--
------------ Alex Holden - http://www.alexholden.net/ ------------
If it doesn't work, you're not hitting it with a big enough hammer
More information about the PicForth
mailing list