Hello,
I'm new to the Arduino forums, so be patient with me.
I'm taking a machine language course and I'm stuck trying to figure out how to add ".s" compatibility on my personal computer. The professor posted this:
"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:"
The problem is, I cannot find the app/src/processing/app/Sketch.java . I have searched every folder in my Arduino folder. I also tried searching through all the C: stuff but that'll take forever. I tried searching google for a while with no luck. I can't find the app folder, nor any folder after it (obviously). If someone could please help me out.
And why not just rename the files you are trying to include to lower case s extension?
The app folder is part of the Arduino Dev distribution which includes all of the source code. The pre-compiled, typical version does not include it. Well... it does, but it is compiled as a java class and compressed into the pde.jar file in the lib folder.
hammafer:
Hello,
I'm new to the Arduino forums, so be patient with me.
I'm taking a machine language course and I'm stuck trying to figure out how to add ".s" compatibility on my personal computer. The professor posted this:
"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.
Well the existing GCC convention is upper case .S files are first run through the C preprocessor to allow #ifdef, #define, etc. and the file after preprocessing is feed to the assembler. If the file ends in a lower case .s, then the file is handed directly to the assembler. So, .S files give you additional capabilities not found in .s files. For example, you could tailor pin assignments, based on what target processor you are building for.
In addition, outside of a function in .c/.cpp files, you can use asm ("..."); and the stuff inside the string is put straight into the resultant asm file produced by the compiler without interpretation.
Finally, inside of functions, you can use asm ("...") or asm volatile ("...") to issue one or more assembly statements in the context of C/C++ code.
Will the entire Arduino source need to be recompiled after someone modifies sketch.java or will the normal Arduino distribution use the uncompressed file put in the proper folder over the one in the compiled jar?
Coding Badly: I saw this, but it doesn't show me how to get to the Sketch.java, etc.
Retroplayer: Is there a way to open the pde.jar file? or do I need to delete and redownload arduino but the Dev distribution version instead? Also, if I had to recompile, do I just do a regular java compile through command line or do I need to do something different?
You can open the pde.jar file with powerarchiver like I used. I'm sure there are other archiving programs that can handle it.
However, what you get is sketch.class which is a compiled binary. Not a file that you can modify easily.
I don't know the answer to your other question. Notice I asked it also.
It may be as simple as just downloading the file that codingbadly linked and putting it in the proper folder in your normal Arduino folder. The launcher might view it as a patch and run the uncompressed version instead of the compressed version. You could certainly try. If it doesn't work or causes a problem, just delete it and no harm done.
To try it, you need to create this folder structure in the Arduino main folder:
processing/app/
and place the sketch.java file in there.
Otherwise, yes, you will need to download the full source code (which is the main link in the one CodingBadly gave) and then recompile. I think there are instructions there to do it.