Assembly Syntax Issue
All about the OSDev Wiki. Discussions about the organization and general structure of articles and how to use the wiki. Request changes here if you don't know how to use the wiki.
Assembly Syntax Issue
In the articles of the osdev wiki (that I have visited) only Intel syntax is used, even though not everyone knows Intel syntax, especially in OS development (Linux kernel using AT&T).
I suggest to add something like a toggle on assembly snippets to choose between AT&T and Intel syntax.
I suggest to add something like a toggle on assembly snippets to choose between AT&T and Intel syntax.
- Octocontrabass
- Member
Member - Posts: 6013
- Joined: Mon Mar 25, 2013 7:01 pm
Re: Assembly Syntax Issue
Post by Octocontrabass »
I think maintaining two versions of every x86 assembly snippet would be more effort than it's worth.
Re: Assembly Syntax Issue
I disagree.
There are tools like intel2gas that do exactly this thing. The only thing required by the maintainer is to rewrite assembly-time operations, like "~(1 << 31)" to the GAS equivalent, and check for any other faults.
The problem is mainly the inconvenience of having to copy paste every assembly snippet to an external tool in every article I visit.
The implementation of the feature I proposed can easily be automated, and I see no reason why it isn't a good idea.
There are tools like intel2gas that do exactly this thing. The only thing required by the maintainer is to rewrite assembly-time operations, like "~(1 << 31)" to the GAS equivalent, and check for any other faults.
The problem is mainly the inconvenience of having to copy paste every assembly snippet to an external tool in every article I visit.
The implementation of the feature I proposed can easily be automated, and I see no reason why it isn't a good idea.
- Octocontrabass
- Member
Member - Posts: 6013
- Joined: Mon Mar 25, 2013 7:01 pm
Re: Assembly Syntax Issue
Post by Octocontrabass »
[引用]
[引用] Sure, but the wiki isn't the only resource you'll use. If you learn Intel syntax, you'll be able to read x86 code everywhere.
rectrap wrote: ↑ Sun Aug 17, 2025 4:11 pmThe only thing required by the maintainer is to rewrite assembly-time operations, like "~(1 << 31)" to the GAS equivalent, and check for any other faults.
That still sounds like maintaining two versions of the same code.[引用] Sure, but the wiki isn't the only resource you'll use. If you learn Intel syntax, you'll be able to read x86 code everywhere.
Re: Assembly Syntax Issue
[引用]It's a wiki, so you are welcome to make the change.
Personally, I would hope that people use any code pasted here as a guideline rather than a source to paste and copy. The exercise of translating from one syntax to the other will aid their understanding of the code. This site is a resource for experienced programmers; I would expect them to have no difficulty in manually translating the code.
Similarly, some code snippets are presented in C. Some people may want to use C++, Rust, Ada, or other languages. Again, they should be capable of translating example code to their preferred language.
Personally, I would hope that people use any code pasted here as a guideline rather than a source to paste and copy. The exercise of translating from one syntax to the other will aid their understanding of the code. This site is a resource for experienced programmers; I would expect them to have no difficulty in manually translating the code.
Similarly, some code snippets are presented in C. Some people may want to use C++, Rust, Ada, or other languages. Again, they should be capable of translating example code to their preferred language.