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.
Post Reply
5 posts • Page 1 of 1
rectrap
Posts: 2
Joined: Sat Aug 16, 2025 10:55 am

Assembly Syntax Issue

Post 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.
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.
rectrap
Posts: 2
Joined: Sat Aug 16, 2025 10:55 am

Re: Assembly Syntax Issue

Post 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.
Octocontrabass
Member
Member
Posts: 6013
Joined: Mon Mar 25, 2013 7:01 pm

Re: Assembly Syntax Issue

Post 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.
iansjack
Member
Member
Posts: 4876
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Assembly Syntax Issue

Post 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.
Post Reply

5 posts • Page 1 of 1

Return to "OSDev Wiki"