Assembly Language Style

Sebastian Huber sebastian.huber at embedded-brains.de
Wed Aug 7 13:50:48 UTC 2019


----- Am 7. Aug 2019 um 15:40 schrieb joel joel at rtems.org:

> On Wed, Aug 7, 2019 at 8:29 AM Sebastian Huber <
> sebastian.huber at embedded-brains.de> wrote:
> 
>> ----- Am 7. Aug 2019 um 15:20 schrieb joel joel at rtems.org:
>>
>> > Hi
>> >
>> > Most times I teach a class, I end up walking though initialization of
>> some
>> > SPARC
>> > BSP and thus the SPARC shared start.S. This file is internally
>> inconsistent
>> > and I
>> > didn't remember us having a defined style for assembly language files.
>> > Specific
>> > issues in this file:
>> >
>> > + tabs vs spaces to separate label, instructions, and comment
>> > + line 376 instruction doesn't align
>> >
>> > How do we want to format assembly language files?
>> >
>> > And did I miss any style guidance?
>>
>> I don't think we have a style guide for assembly language.
>>
>> I would prefer to use a style similar to the GCC output.
>>
> 
> That uses a tab for placing the instruction and one between the
> mnemonic and arguments.

Yes.

> 
> But there are no comments past the instruction. Tabs there also?

I would use /* style */ comments indented by one tab. They seem to work everywhere.

> 
> And it looks like tabstop=8 for it to look reasonable.

Yes.



More information about the devel mailing list