How do I configure emacs to "play nice" with assembly code to be compiled by the gnu assembler?
asm-mode assumes that the semi-colon is the only comment character. gas allows '#', '//', and '/* */'.
I figured out how to change the comment character to '#' using (setq asm-comment-char ?\#); but, indenting and line breaking still don't work right.
Specifically, if I type a long comment and press M-q, the lines break, but the additional lines are not prefixed by '#'. If I edit a comment and press M-q, the lines break, but the existing comment characters end up in the middle of lines.
Support for '//' and '/* */' would be nice, but I'll be happy if I can just get the '#' comments to re-balance when I edit them.
If there aren't any good solutions for emacs, can anybody suggest a better editor? (I did check out SASM, but it doesn't appear to "re-balance" comments. CLion only recently added syntax highlighting for assembly, and my University won't upgrade the image until the end of summer term.)
Configure emacs to handle gas-style comments
Re: Configure emacs to handle gas-style comments
If you're a student, you can get a personal copy of CLion (and most of the rest of JetBrains' products) for free, so you don't have to wait for the university to upgrade.kurmasz wrote:CLion only recently added syntax highlighting for assembly, and my University won't upgrade the image until the end of summer term.
Re: Configure emacs to handle gas-style comments
It turns out that even the current version of CLion doesn't handle multi-line comments very well.
Also, for what it's worth: My personal machine is a Mac, and the llvm linker doesn't appear to have sufficient flexibility to build an OS. The workflow will be much more convenient if I can use tools that I can build and run in Linux userspace.
Also, for what it's worth: My personal machine is a Mac, and the llvm linker doesn't appear to have sufficient flexibility to build an OS. The workflow will be much more convenient if I can use tools that I can build and run in Linux userspace.
Re: Configure emacs to handle gas-style comments
Personally, I use vim. Works fine for intel syntax, but for GAS syntax you might have luck with https://github.com/Shirk/vim-gas (disclaimer: never tried it.)
And from what I heard development tools on Mac is weird, ranging from shipping an ancient version of GCC to Clang being symlinked to GCC. Though, if you are following the cross-compiler instructions it shouldn't be an issue.
And from what I heard development tools on Mac is weird, ranging from shipping an ancient version of GCC to Clang being symlinked to GCC. Though, if you are following the cross-compiler instructions it shouldn't be an issue.