User forums > Embedded development

Assembler tools for CB

<< < (2/7) > >>

scarphin:

--- Quote from: stahta01 on March 07, 2014, 10:35:00 pm ---Another thing the E::B has is a location in the tool chain setting for the hex tool.
The hex tool is needed by many Embedded Compilers.

Hex tool converts object code (Binary) to hex code (ASCII).
Link to images http://community.silabs.com/t5/32-Bit-Discussion/Em-Blocks-IDE-with-EnergyMicro-support/td-p/107147

--- End quote ---
I think inclusion of the hex tool won't be a good idea because it doesn't have a standard among compilers. Take AVR for example, there are many post processing steps to separate the object file (.elf) into output files program, eeprom, fuses, lock bits, signature etc... That is not the case for i.e. PICs so how would the hex tool behave for each compiler will complicate the things much more than it should imo. I vote on post processing for hex tool.


--- Quote from: oBFusCATed on March 07, 2014, 10:41:25 pm ---As far as I know we have syntax highlight for asm files.
Syntax highlight is a job of scintilla, so if your asm variant isn't supported then post a bug report to them.
After they make a lexer for it we can easily expose it in the options.
If it is supported by scintilla and it is not exposed, please say so and I'll expose it (it is pretty trivial task).

--- End quote ---
I think that would be more than enough for the editor support of assembler files.


--- Quote from: oBFusCATed on March 07, 2014, 10:41:25 pm ---About separate options:
What king of options?
Do you want to have check boxes with the most common options?
We could probably add another tab in Build options -> Compiler settings (next to the tab "Other options").
How often do you edit asm files by hand in the embedded world?
In the desktop/server world people (almost) never need to do it.

--- End quote ---
For separate options I was thinking about the lines of assembler flags (yeah checkboxes would be nice) to be inserted directly into the assembler command line.
For the tab position why not add it next to 'Compiler settings' and 'Linker settings' as 'Assembler settings' in 'Build options'? It would be nice to make use of flags, other options and defines for the assembler too just as the compiler.
I edit assembler files for a couple of reasons in my embedded work. First to see what the compiler is generating in case I suspect a compiler bug, second to create optimized routines in case I am in a very narrow time window to perform that routine, third to code general purpose hand optimized libraries specific to my needs. These are some usages I can think of in the first place but as I mentioned in the other topic, I don't think assembler usage is that little in the desktop world judging by the fact that even I know a couple of assembler gurus from school and work despite me being a no desktop programmer at all. ;)


--- Quote from: oBFusCATed on March 07, 2014, 10:41:25 pm ---As far as you probably know it is not problem to add asm files to the build system http://wiki.codeblocks.org/index.php?title=Adding_support_for_non_C/C%2B%2B_files_to_the_build_system
Probably we can add asm support for specific compilers in the trunk version of C::B.
Can you provide patches for the compilers you're using?

--- End quote ---
I am aware of that method to add support for non C/C++ files in the build system and I've been using it if needed. But I don't think that would be a comparison to native support of assembler files because it is hard to use and customize.
Please forgive my ignorance, what kind of patches do you need and for which compilers? Patches for compilers that have an assembler included?

stahta01:
I am looking at the E::B SDK (modified from CB SDK).

Thinking of trying a patch to add these things.

ASM
ftAssembler
ctAssembleObjectCmd
$assembler

Those are in 14 files in the SDK, 2 in the src folder, and 1 script binding file.

I figure all the other possible changes will require this one; that looks bigger than I would have guessed.

Tim S.

oBFusCATed:
@scarphin:
1. Is syntax highlighting working for your assembler files or not? Does scintilla support them?
2. I'd prefer to give you just a field where you can type all the options for assembler compilation, everything else seems, too complex. Also there are too many tabs in this dialog already.
3. Do you need to specify different linker flags for the asm files?
4. Desktop people use inline asm or intrinsics. (Almost) No one would bother to write pure asm for more then couple of routines in a project.
5. The options for every compiler are stored in options_*.xml files. I thought that it would be possible to add the asm commands there, but looking at the code this is not the case. So a modification is needed.

@alpha01: Am I correct about 5 or not?
@stahta01: The compiler/sdk in E::B is probably using the old non generic/xml based compilers, so patches taken from there won't work.

scarphin:
@obfuscated:
1- Syntax highlighting can only distinguish comments, numbers and punctuation (equal sign, comma etc...), I don't get a special color on keywords if that's what you are asking. I never delved into this as it's clear that every mcu's assembler is specific to itself. I do get syntax highlighting for assemblers on the list at 'settings->editor->syntax highlighting->syntax highlighting for', masm for example. Btw I found the link below that makes it possible to introduce other languages to notepad++:
http://sourceforge.net/apps/mediawiki/notepad-plus/?title=User_Defined_Language_Files#P
2- Assembler compilation options would be a good start but I believe locating the assembler settings tab under the compiler settings tab will make it look like assembly step is a sub-process of compilation step, don't you think?
3- I didn't need to but I've never done any C++ work with any embedded compiler either. So I can't judge on this.
4- I completely agree but it's that a couple of routines that makes the usage. ;)
5- I think you're right.

oBFusCATed:
1. We have something similar. See here http://wiki.codeblocks.org/index.php?title=Creating_a_custom_lexer_for_Code::Blocks_editor
2. I don't think, so. Probably we should even make it the same for C and C++ (add separate tabs for them).
3. I think that if you need to you can pass the settings in the current options. Because I suppose that the asm file will be compiled to object file (.o) and then linked as other object files in a single commands. So I don't think there will be a need for it.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version