Author Topic: Assembler tools for CB  (Read 47497 times)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Assembler tools for CB
« Reply #15 on: March 10, 2014, 10:29:17 am »
1. Do you know if all assembler variants use the same lexer? We could probably add some smarter detection mechanism in the editor.
2. As far as I'm concerned an asm file is compiled to an object file and I don't see how this is different to c++ to object file translation. If there is not conceptual difference then the settings should go in the compiler's tag.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline scarphin

  • Lives here!
  • ****
  • Posts: 644
Re: Assembler tools for CB
« Reply #16 on: March 10, 2014, 01:25:45 pm »
1- I don't know if they all use the same lexer but considering the simplicity of assembler syntax (usually in the form -> label: instruction operand(, operand) ;comment), a specific lexer should perform quite well for another assembler with correct keywords.
2- My point is assembler files are not compiled rather assembled into object files with an assembler but I now see your point. You are thinking in the 'end product' concept and I'm thinking in the 'process' http://nixchun.pixnet.net/blog/post/12331954-basic-introduction---gcc concept. Both are valid imo, just 2 different approaches. But if I needed to look for assembler settings as a first time user, compiler settings wouldn't be the first place I'd look. Maybe that's the reason emblocks maintainer implemented them next to compiler settings.

« Last Edit: March 10, 2014, 01:29:37 pm by scarphin »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Assembler tools for CB
« Reply #17 on: March 10, 2014, 10:29:08 pm »
1. I'm waiting for you to test and probably provide some missing lexers. Are you willing to do this job?
2. By looking at the E::B screenshot I see that there you can pass defines separately to the ASM compiler (assembler in your term) and C/C++ compiler. Do you need this capability? I think this might be annoying in most cases.
 
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline scarphin

  • Lives here!
  • ****
  • Posts: 644
Re: Assembler tools for CB
« Reply #18 on: March 11, 2014, 03:31:55 am »
1- I'll try. I have some urgent things to do at the moment, I'll let you know if I make progress.
2- I never had to make separate defines for assembler but I can think of many ways assembler programmers can benefit from it especially for debugging and testing. So it would be nice to have this capability imo. May I ask which part do you think is annoying? The implementation or the usage?

Btw do you think extra search paths for assembler under search directories can be implemented too?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Assembler tools for CB
« Reply #19 on: March 11, 2014, 08:15:58 am »
May I ask which part do you think is annoying? The implementation or the usage?
For me it will be annoying if I have to enter the same defines at two places.

Btw do you think extra search paths for assembler under search directories can be implemented too?
It is possible, but is it needed? The question is same as the one for defines: would they be different than C/C++ ones most of the times?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline scarphin

  • Lives here!
  • ****
  • Posts: 644
Re: Assembler tools for CB
« Reply #20 on: March 11, 2014, 09:53:38 am »
May I ask which part do you think is annoying? The implementation or the usage?
For me it will be annoying if I have to enter the same defines at two places.
Ok, I got your point. As I previously mentioned, pure assembler projects are not uncommon in the embedded world. Considering that, how convenient it would be to enter the defines to be used with assembler into C/C++ defines? I think that wouldn't be good practice. I agree there may be times to enter same defines in both places but not all the time.

Btw do you think extra search paths for assembler under search directories can be implemented too?
It is possible, but is it needed? The question is same as the one for defines: would they be different than C/C++ ones most of the times?
I think you should consider library paths here. I can't think of a reason why C/C++ and Assembler libraries (or hand-crafted routines) should be kept in the exact same folder. In the current cb implementation, it's impractical and error prone to enter the library paths in the command line for non C/C++ files to assemble the assembler files. So what I do is to copy the library file to the source folder and then include it. If search paths for assembler were available that would be way too much practical and convenient. ;)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Assembler tools for CB
« Reply #21 on: March 11, 2014, 08:10:22 pm »
What do you mean by pure assembler project? Can you post a listing of an example real-world project?

Because if you have a project made only of asm files, then you can use both defines and search paths for the c/c++.
The only point to have separate options for asm and c/c++ is when you have a mixed source project and you need to specify different options for different files.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline scarphin

  • Lives here!
  • ****
  • Posts: 644
Re: Assembler tools for CB
« Reply #22 on: March 12, 2014, 10:08:20 am »
By 'pure assembler project' I mean a project consisting of only assembler files. By 'listing' do you mean a listing file (.lst)? If yes, there is one with C source in the link below for avr-gcc:
http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=73133
If you were talking about something else, please elaborate.

Because if you have a project made only of asm files, then you can use both defines and search paths for the c/c++.
Then is there a specific reason not to merge the compiler and linker search paths too?

The only point to have separate options for asm and c/c++ is when you have a mixed source project and you need to specify different options for different files.
Mixed source projects has a percentage in the embedded world, that's the main reason I was asking for assembler support in the beginning.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Assembler tools for CB
« Reply #23 on: March 12, 2014, 08:29:55 pm »
If you were talking about something else, please elaborate.
On unix the command is find <root_of_project> on windows dir /s <root_of_project>. I just want to see a real world project structure. I want to see the layout on disk.

Then is there a specific reason not to merge the compiler and linker search paths too?
Yes, because 99% of the times they are different, because headers and library files are stored in different locations.

Mixed source projects has a percentage in the embedded world, that's the main reasonI was asking for assembler support in the beginning.
Okay.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline scarphin

  • Lives here!
  • ****
  • Posts: 644
Re: Assembler tools for CB
« Reply #24 on: March 13, 2014, 03:19:29 am »
If you were talking about something else, please elaborate.
On unix the command is find <root_of_project> on windows dir /s <root_of_project>. I just want to see a real world project structure. I want to see the layout on disk.
Sry doesn't compute. ;) An assembler library or a mixed source or a project for some other software or...?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Assembler tools for CB
« Reply #25 on: March 13, 2014, 08:41:52 am »
Something that is common...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline scarphin

  • Lives here!
  • ****
  • Posts: 644
Re: Assembler tools for CB
« Reply #26 on: March 16, 2014, 04:02:09 am »
Sorry for the delay, been busy. Link below is a TCP/IP stack implementation for AVR mcus.
https://github.com/adamdunkels/uip

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Assembler tools for CB
« Reply #27 on: March 16, 2014, 04:49:25 am »
Sorry for the delay, been busy. Link below is a TCP/IP stack implementation for AVR mcus.
https://github.com/adamdunkels/uip


Is that project supposed to have assembly only files in it?
My quick look saw no assembly files.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline scarphin

  • Lives here!
  • ****
  • Posts: 644
Re: Assembler tools for CB
« Reply #28 on: March 16, 2014, 07:01:56 am »
No, I don't think so.

Something that is common...
I just thought he wanted to see the directory structure, nothing special about asm. As far as asm files are concerned, I put them besides the C source files not in a special folder dedicated to them. Only my libraries are in different folders than C libraries.

I'm really puzzled here what he's trying to work out. Obfuscated more info please!

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Assembler tools for CB
« Reply #29 on: March 16, 2014, 02:55:41 pm »
I want to see the structure of a common project, that's it...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]