Tag Archives: gcc

Arduino Due Assembly Language Listing of Compiled Sketch (Windows)

1) Compile your sketch with verbose output turned on during compilation. 2) Find the ELF file – One of the last commands in the output window will be an “avr-objcopy” targetting the compiled (.elf) file of your sketch. Find and … Continue reading

Posted in Uncategorized | Tagged , , , , , | Leave a comment

Arduino s16.15 Fixed Point Math Routines

It is important to note, that fixed point math comes in many flavors. For example, a 16-bit integer can implement 31 different fixed point formats, signed and unsigned Q1 through Q16 (Q number format). A couple of popular 16-bit formats … Continue reading

Posted in Uncategorized | Tagged , , , , , , , , , , , , , , | Leave a comment

AVR GCC Fixed-Point vs. Floating Point Comparison

This is a follow up to previous posts here and here. Using native fixed point support in GCC, on a generic ATMega328P running 16MHz on the AtmelStudio 6.2 simulator, I performed this overly simplified comparison of fixed vs. floating point … Continue reading

Posted in Uncategorized | Tagged , , , , , , , | 7 Comments

Passage of AVR GCC Function Parameters

For the curious, below is the method and order that parameters are passed to and from functions in the 8-bit AVR GCC world. A description of the method is given here. uint8_t func1(uint8_t a, uint8_t b, uint8_t c, uint8_t d) … Continue reading

Posted in Uncategorized | Tagged , , , , , | Leave a comment

Arduino Disassembly: Who Put This Stuff Here?

Ever wonder what all of the code inserted at the beginning of your program that appears in a disassembly listing is about? Well it’s a bunch of required housekeeping routines that are linked into your program at compile time that … Continue reading

Posted in Uncategorized | Tagged , , , , , , | 1 Comment

GCC Inline Assembler Cookbook

Here is a most basic example: The general form of an inline assembler statement is: The special sequence of linefeed and tab characters helps keep the assembler listing looking nice, and is required to prevent more than one instruction appearing … Continue reading

Posted in Uncategorized | Tagged , , , , , , , , | 3 Comments

Arduino Blink Using GCC Inline Assembly

At less than 490 bytes, this version is less than half the size of the Arduino example program. Obviously, it could be made smaller. Note: Updated 3.16.2016 to conform with Arduino Inline Assembly Tutorials. Also available as a book, with … Continue reading

Posted in Uncategorized | Tagged , , , , , , | 18 Comments