Skip to content

style: change x86 inline asm from AT&T syntax to intel#63

Merged
hawkw merged 3 commits intomasterfrom
eliza/intel
Jan 22, 2020
Merged

style: change x86 inline asm from AT&T syntax to intel#63
hawkw merged 3 commits intomasterfrom
eliza/intel

Conversation

@hawkw
Copy link
Owner

@hawkw hawkw commented Jan 20, 2020

As discussed in #59 (comment), it's good to standardize on a
syntax, and @mystor and I both have a minor preference for Intel over
AT&T syntax. Also, when the work started in PR #61 merges, we will be
showing disassembly in crash screens using Intel syntax, so we should
use consistent syntax in source.

This PR changes inline assembly to use Intel syntax. In cases where the
inline assembly is a single instruction with no syntactic differences
between AT&T and Intel syntax (e.g. "cli", "hlt", et cetera), I did not
add the "intel" flag to the asm! macro. I can if we'd prefer this to
be explicit, but the syntax is currently equivalent.

Signed-off-by: Eliza Weisman eliza@buoyant.io

As discussed in [#59 (comment)][1], it's good to standardize on a
syntax, and @mystor and I both have a minor preference for Intel over
AT&T syntax. Also, when the work started in PR #61 merges, we will be
showing disassembly in crash screens using Intel syntax, so we should
use consistent syntax in source.

This PR changes inline assembly to use Intel syntax. In cases where the
inline assembly is a single instruction with no syntactic differences
between AT&T and Intel syntax (e.g. "cli", "hlt", et cetera), I did not
add the "intel" flag to the `asm!` macro. I can if we'd prefer this to
be explicit, but the syntax is currently equivalent.

[1]: #59 (comment)

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
@hawkw hawkw requested review from iximeow and mystor January 20, 2020 18:00
@hawkw
Copy link
Owner Author

hawkw commented Jan 20, 2020

asm_syntax

@hawkw hawkw changed the title chore: change x86 inline asm from AT&T syntax to intel style: change x86 inline asm from AT&T syntax to intel Jan 20, 2020
Signed-off-by: Eliza Weisman <eliza@buoyant.io>
@hawkw
Copy link
Owner Author

hawkw commented Jan 20, 2020

@iximeow any hot takes?

Copy link
Collaborator

@iximeow iximeow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

intel made the isa so obviously they know assembly more gooder

(i generally like intel syntax as evidenced by 'yaxpeax doesn't even know how to print at&t' so)

@hawkw hawkw merged commit 460bfa3 into master Jan 22, 2020
@hawkw hawkw deleted the eliza/intel branch January 22, 2020 00:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants