Page 1 of 1

Assembly Syntax Issue

Posted: Sat Aug 16, 2025 11:07 am
by rectrap
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.

Re: Assembly Syntax Issue

Posted: Sat Aug 16, 2025 9:28 pm
by Octocontrabass
I think maintaining two versions of every x86 assembly snippet would be more effort than it's worth.

Re: Assembly Syntax Issue

Posted: Sun Aug 17, 2025 4:11 pm
by rectrap
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.

Re: Assembly Syntax Issue

Posted: Sun Aug 17, 2025 5:16 pm
by Octocontrabass
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.
rectrap wrote: ↑Sun Aug 17, 2025 4:11 pmThe problem is mainly the inconvenience of having to copy paste every assembly snippet to an external tool in every article I visit.
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

Posted: Mon Aug 18, 2025 5:48 am
by iansjack
rectrap wrote: ↑Sun Aug 17, 2025 4:11 pm I disagree.
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.