Eralt / arduino

Automatically exported from code.google.com/p/arduino
0 stars 0 forks source link

Allow Arduino environment to use assembyl source files #359

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What change would like to see?

I've made local mods to Arduino to allow it to use assembly source files, and 
think they would be generally useful, especially in education (we are using 
Arduino in our assembly-language course). 

The backend "Processing" code already has the logic to invoke the compiler 
correctly for assembly source files, so the mods only enable Arduino to see the 
files and display them in the editor. The changes are simple:

Sketch.java:

1345c1345,1346
<       if (sc.isExtension("c") || sc.isExtension("cpp") || 
sc.isExtension("h")) {

---
>       if (sc.isExtension("c") || sc.isExtension("cpp") ||
>           sc.isExtension("s") || sc.isExtension("h")) {
1802c1803
<     return new String[] { "pde", "c", "cpp", "h" };

---
>     return new String[] { "pde", "c", "cpp", "h", "s" };

and Compile.java:

106c106
<                    findFilesInPath(corePath, "S", true),

---
>                    findFilesInPath(corePath, "s", true),
138c138
<                      findFilesInFolder(libraryFolder, "S", false),

---
>                      findFilesInFolder(libraryFolder, "s", false),
146c146
<                      findFilesInFolder(utilityFolder, "S", false),

---
>                      findFilesInFolder(utilityFolder, "s", false),
158c158
<                    findFilesInPath(buildPath, "S", false),

---
>                    findFilesInPath(buildPath, "s", false),

Would this cause any incompatibilities with previous versions?  If so, how
can these be mitigated?

There are no incompatibilities with earlier Arduino versions but the Processing 
code uses a capital "S" to indicate assembly source files and I used the more 
traditional gnu extension of lowercase "s". It probably would not be hard to 
support both. It seems like AVR environments for some reason use a capital "S" 
for assembly files, so compatibility with other AVR environments might be 
desirable.

Feel free to contact me at jcook (AT) cs (dot) nmsu (dot) edu

Original issue reported on code.google.com by joncoo...@gmail.com on 27 Sep 2010 at 4:45

GoogleCodeExporter commented 9 years ago
Adding support for editing assembly is a bigger task, so I think we should 
stick to supporting them in libraries and cores for now.

Original comment by dmel...@gmail.com on 27 Sep 2010 at 5:10

GoogleCodeExporter commented 9 years ago
I understand, but will just plead my case one more time :-) It is a very small 
change, just allowing the IDE to recognize .s files, and although there's no 
syntax support for assembly the editor works OK with them, and with larger 
projects Arduino can be put into external-editor mode anyways. I won't continue 
to bug you with followups, so whatever you decide is ok, but I do think the 
Arduino environment could really be useful for teaching courses in assembly 
programming, but most instructors won't take the effort to make custom mods to 
the environment. I'm going to put up a public page detailing my mods, so 
eventually google will pick it up and others can find out how to do it.

Original comment by joncoo...@gmail.com on 28 Sep 2010 at 3:31

GoogleCodeExporter commented 9 years ago
I know it could be useful, but I'd rather not support it if it's not going to 
work right.  I'd like to work on per-sketch libraries (e.g. a code/ 
sub-folder), so that could be a good place to put assembly source code.  

Original comment by dmel...@gmail.com on 28 Sep 2010 at 5:17