¿ªÔÆÌåÓý

Re: ArduinoShrink - reduced size Arduino AVR Core


 

If it's at least a 16 bit machine and either has lots of registers or an easy way to
access words in RAM as an offset from the stack pointer,?C is the way to go.?
This applies to pretty much all modern processors.

The instruction set for the MSP430 is designed for C and is very simple,
worth looking over (the peripherals are a tough read though).?
I'd be hard pressed to write assembly language for it that was faster than compiled C.
The old Sun Sparc was pretty good too, especially if access to stack space
in main memory was slow.

The ATMega328P, not so much.? ?
A very small 8 bit machine, and the Harvard architecture limits access to data stored in flash.

https://www.reddit.com/r/linux/comments/73in9/computer_holy_wars_png/

Jerry, KE7ER


On Wed, Apr 7, 2021 at 10:31 PM, Tom, wb6b wrote:
On Wed, Apr 7, 2021 at 09:33 AM, <quad@...> wrote:
ArduinoShrink?replaces Arduino AVR Core functions with smaller and faster versions.
The Arduino Blink example sketch built for the Uno takes 924 bytes of flash, but only needs
196 bytes with ArduinoShrink.
Looks really cool.?

Upon reading his explanation of his code, I need to revisit my assumption that writing assembly is almost never worth the effort now days.?

Although it looks like he put an additional restriction on specifying pin numbers (probably not a bad thing) to do some shrinking in the wiring library.

Tom, wb6b

Join [email protected] to automatically receive all group messages.