Assembly Language Style

Gedare Bloom gedare at rtems.org
Wed Aug 7 15:54:58 UTC 2019


On Wed, Aug 7, 2019 at 7:50 AM Sebastian Huber
<sebastian.huber at embedded-brains.de> wrote:
>
> ----- 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.
These look reasonable. tabstop is a local setting so no need to
specify it as part of the style.

Anything that is not an instruction is not tabbed in?

No tabs/spaces for logically indenting structures / critical sections
in the asm?

> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel



More information about the devel mailing list