|
|
|
|
|
by PaulHoule
318 days ago
|
|
I still use C to write little programs for Ardunio but it drives me nuts thinking about all the useless stuff C is doing with the stack and calling convention when I could just use global variables for everything and sometimes even use nothing but registers for inner loop variables. I stick with C because (1) I'd have to figure out the tooling for 100% assembly development on AVR-8, and (2) C is portable to other platforms so if I want to migrate to an ARM or ESP-32 board it would be easy. (The upward migration path for AVR-8 is to go to a soft core on an FPGA but talk about frying pan to the fire) |
|
With namespaces you can have globals and few collisions. At the expense of more typing, of course.
You do know about the "register" storage class/keyword, I am sure. Sometimes it works.
Edit - the tooling for AVR assembler seems to be avr-gcc and make. Check out Nerd Ralph's "ArduinoShrink" library for an example of blended C and assembler:
https://github.com/nerdralph/ArduinoShrink/tree/master