Recent Changes - Search:

References

Notes

edit SideBar

AssemblyMods

The Arduino environment can easily be modified to allow assembly source files to be used in the IDE. In fact, the back-end compiler invocation code already supports it, and what is needed is simply to allow the IDE to recognize and support the Assembly files.

The existing back-end code assumes a capital-S file extension, but in keeping with the gcc conventions, we support a lowercase .s extension to indicate an assembly file.

This page describes the changes to the arduino-0022 distribution, but the locations of the changes should be easily found in later distributions. The actual modified files can be grabbed here: Sketch.java and Compiler.java

In the file app/src/processing/app/Sketch.java, near line 1343, add support for recognizing the .s extension by adding a clause to the if-condition, as:

    for (SketchCode sc : code) {
      if (sc.isExtension("c") || sc.isExtension("cpp") || 
          sc.isExtension("h") || sc.isExtension("s")) {
        // no pre-processing services necessary for java files

Then in the same file around line 1802, add "s" to the list of extensions, as:

  public String[] getExtensions() {
    return new String[] { "pde", "c", "cpp", "h", "s" };
  }

I have no idea why the code around line 1343 does not use the getExtensions() method, but it should. I am trying to make minimal changes so I'm not fixing existing code ;-)

Then in the file app/src/processing/app/debug/Compiler.java, starting around line 108 you will see four calls to compileFiles() that include a search for files with a capital-S extension. Change these to a lowercase s.

That's it! Rebuild the arduino environment and it will support Assembly files! Note that these files must be in gcc-syntax assembly code, which might have slight differences to official Atmel AVR assembly code.

Edit - History - Print - Recent Changes - Search
Page last modified on 2011-02-18 23:49