Nerd Ralph drafted some simple instructions for programming lightweight AVR assembly functions.
Although I’ve been programming in AVR assembler for a few years now, it has taken me a while to learn inline asm. I still prefer writing in plain asm, but inline asm is the only way I’ve found to call assembler functions from C without having to follow the standard calling convention. The sample code at the start of this post defines a function named eelog that takes a single parameter passed in r26 (the low byte of the X register).
Source code can be found on GitHub.
Have an amazing project to share? Join the SHOW-AND-TELL every Wednesday night at 7:30pm ET on Google+ Hangouts.
Join us every Wednesday night at 8pm ET for Ask an Engineer!
Learn resistor values with Mho’s Resistance or get the best electronics calculator for engineers “Circuit Playground” – Adafruit’s Apps!
Maker Business — Presentation: Ten Year Futures – Benedict Evans
Wearables — Toy with inspiration
Electronics — Servo Pulses
Biohacking — Nutrigenomics – Personalized Vitamin Supplements Based on DNA
No comments yet.
Sorry, the comment form is closed at this time.