Topic : Assembly related observations

Forum : Ride IDE

Original Post
Post Information Post
May 12, 2009 - 1:52pm


Observations related to assembler files and RIDE (Ride7 IDE version 7.18.0903 Rkit-Arm for Ride7 version 1.18.0903):
- Assembler files must apparently be named .S (Capital S) not .s if you want to run the C-preprocessor

- Ride automatically changed the capital .S to a lowercase .s when editing an Assembler file - In project the capital S stays and preprocessor is still run unless file is removed and readded to project

- // and /**/ comments are not colorized as comments in an .S (capital S) file, ; is however.. But ; is not a valid comment in .S files.

- Several other keywords like .globl .syntax, #define are not highlighted.


Post Information Post
May 12, 2009 - 3:01pm
Raisonance Support Team

Hi Henrik,

Thanks for this detailed report.

Concerning the preprocessor you are right: You must use capital S (.S) extensions for assembler files to be handled by the C preprocessor. This is standard gcc usage.

Ride will keep the exact file name of the file as it is created in your project: If you add a .s file to your project, you cannot rename it to .S (nor the contrary). This makes files transfers foolproof, as if you copy you source files to a FAT12 diskette, they will be uppercased. Even in such a case Ride7 will keep working fine with your project. The bias is that it is NOT possible to change the casing of files, you have to remove them from your project and re-add them.

C preprocessor is not highlighted in assembly files (C or C++ comments and #if, #define, #elif, etc are not highlighted) under Ride7.

We corrected the list of directives and keywords to be highlighted. The directives .error .globl .purgem .pushsection .quad .rept .sbttl .scl .set .short .single .size .skip .sleb128 .space .stabd .stabn .stabs .string .struct .subsection .syntax .vtable_entry .vtable_inherit will be added in the next release of RKit-ARM.

Best Regards,

May 12, 2009 - 3:33pm

Thanks for the reply..

Steps to reproduce..
1. Add a assembly file, which requires preprocessing with a lowercase .s (foo.s)
2. doubleclick the file in the project to open it in the editor
3. Try to compile. It fails as expected because preprocessor is not run.
4. Select the file in the project window and delete it from the project (without closing the editor window where foo.s is)
5. Rename the assembler file to foo.S (uppercase extension) and drag it into the project again
6. doubleclick foo.S (uppercase) in the project - Notice that foo.s (lowercase) is activatad as the file to edit in the editor..
7. make a change to the file and save
8. Notice in filemanager that the foo.S is changed to foo.s
9. compilation works until you remove and re-add the foo.s (Since project remember the .S extension until file is removed)

Possible fixes:
- When doubleclicking foo.S in the project update foo.s editor pane to reflect the changed extension
- Warn that foo.s (lowercase) have been deleted or renamed and ask user what to do when returning to RIDE
- When doubleclicking foo.S in the project open a new editor tab with the correct filename.

I really think that when that when editing files that are preprocessed - The preprocessor directives should be highlighted.. Larger assembly files are a mess to read when you use preprocessor directives in them. At the very least the comments should be highlighted.. And nonvalid comments like ; should NOT be highlighted.


May 14, 2009 - 10:08am

Please let me know if you don't understand the issue?
The short version is that RIDE make the wrong decision when saving foo.S - RIDE use the name on the top pane, not the correct filename (the one in the project pane).

Ride might well keep track of the fact that the file is intended to compile with the preprocessor, but when saving the file it should also save it with the right capitalization from the project especially because the capitalization is used in decision making during compilation.

I realise that the issue is minor, once you are aware of how it works and I realise that RIDE also have to handle files that are not part of the current project (I.e. you have to use the top pane filename), but it was rather annoying for me, until I figured out why Ride changed capitalization.. I use my .S files in several projects, remove and re-add them during testing.. And since I had the file open in one of my projects I keept getting the .S changed to .s

However I even more hope that you will decide to fix the editor so that it highlights keywords correctly in .S files (preprocessor directives and comments, mosts importantly).. The fact that this is not done, is more a concern than the filenaming.