Author Topic: Support for assembly source  (Read 6730 times)

Offline colinmac

  • Multiple posting newcomer
  • *
  • Posts: 10
Support for assembly source
« on: December 27, 2006, 12:41:40 pm »
I'm trying to build a project that contains a few assembly source files (.s).  Unfortunately the Compiler Settings dialog doesn't allow me to specify an assembler, e.g. the standard GNU as.

Apart from using an external Makefile is there any way for me to tell Code::Blocks to process a .s file?

Thanks,
Colin

Offline colinmac

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Support for assembly source
« Reply #1 on: December 27, 2006, 03:15:31 pm »
A followup on this, for anyone that's interested:  if you select Project / Project Tree / Edit File Types & Categories and add .s and .S to the extensions for Sources then the assembler files will be treated as source files.  This works because gcc will, when presented with assembler source, handle it properly (presumably by invoking the appropriate as executable).

Only problem now is that the editor doesn't open it because 'no handler is registered for this type of file'.  Any suggestions on how to tell the editor that a .s file is OK to open, even just as text?

Colin MacDonald

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: Support for assembly source
« Reply #2 on: December 27, 2006, 03:28:59 pm »
I think it would be a good idea to have full assembler support. Not all compilers have one exe for all which then internally dispatches to another exe like gcc does.

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2773
Re: Support for assembly source
« Reply #3 on: December 27, 2006, 08:12:10 pm »
Only problem now is that the editor doesn't open it because 'no handler is registered for this type of file'.  Any suggestions on how to tell the editor that a .s file is OK to open, even just as text?

When I was working with AngelScript containing assembler, we just named them .cpp files. It worked fine.

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: Support for assembly source
« Reply #4 on: December 28, 2006, 09:19:30 am »
... the editor doesn't open it because 'no handler is registered for this type of file'.  Any suggestions on how to tell the editor that a .s file is OK to open, even just as text?

yes - just register the file type yourself
Settings->Environment->Files Extension Handling

additionally you can also define your own syntax highlighting for your .s files,
containing all the assembler commands and compiler directives, if you want...

brgds
--tiwag

Offline colinmac

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Support for assembly source
« Reply #5 on: December 28, 2006, 10:59:42 am »
I don't have a File Extension Handling option in the Environment settings, but not to worry - if I enable the MIME types plugin then I can tell C::B to open the assembler files in the editor, which is easily good enough.

I got my code to build OK in C::B yesterday using the GNUArm toolset, so I'm happy.   :D  I just have to document the process so that the rest of the guys can pick it up when they get back in the office.

Thanks for everyone's help,
Colin MacDonald

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: Support for assembly source
« Reply #6 on: December 28, 2006, 11:42:19 am »
I don't have a File Extension Handling option in the Environment settings ...

you could have one, if you'd use the Files extension handler plugin :)

Offline colinmac

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Support for assembly source
« Reply #7 on: December 28, 2006, 12:19:53 pm »
 :)   I had a look for plugins to download and can't find any, but I found a reference on the website saying that the current nightly builds are substantial improvements over 1.0 RC2 so I downloaded the Dec 12 build and sure enough there's the file extension plugin!

Also, more importantly, there's specific support for GNUArm!  Now if only there was good support for GDB over a remote serial connection then I'd be extra happy, but the implementation that's there doesn't really work.  I can get it to connect (using a 'target remote' command in the startup) but commands don't make it from the UI through to the debugee.

Still, looking good so far.

Colin MacDonald