Page 1 of 1
x86 binary reference
Posted: Tue May 23, 2017 4:39 am
by Coconut9
I am building an os and I want to create an assembler for x86 processors to insert into the os user can create assembly programs and assembly it to run.Where can I find the x86 binary full reference with all details?
Re: x86 binary reference
Posted: Tue May 23, 2017 4:45 am
by Love4Boobies
Who do you suppose would make this information available? You have 3 guesses.
Re: x86 binary reference
Posted: Tue May 23, 2017 4:46 am
by no92
EDIT: figure it out yourself.
Re: x86 binary reference
Posted: Tue May 23, 2017 4:57 am
by SpyderTL
Intel and AMD both publish their instruction set reference documentation in PDF format. Let us know if you have any trouble finding it.
Re: x86 binary reference
Posted: Tue May 23, 2017 5:49 am
by zaval
moment of humor.

thanks, smiling is healthy.
Re: x86 binary reference
Posted: Tue May 23, 2017 5:58 am
by Octacone
Better.
ARISTOS wrote:I am building an os and I want to create an assembler for x86 processors to insert into the os user can create assembly programs and assembly it to run. Please tell me where can I find the x86 binary full reference with all details?
Please do not use colors, people on this forum "hate" that. It looks
kind of rude, just as if you were demanding something/yelling at us.
The most important ingredient when asking questions is politeness.
If you are talking about executable binary files, take a look at:
http://wiki.osdev.org/ELF //Most commonly used
http://wiki.osdev.org/Category:Executable_Formats //Other documented formats
If you are talking about x86 instructions, take a look at:
https://software.intel.com/sites/defaul ... -3abcd.pdf //Intel
http://developer.amd.com/resources/deve ... s-manuals/ //AMD
I don't know what "create an assembler" means (I do, but that is not what you wanted to ask I guess).
You need to use NASM/FASM/GNU-GAS/YASM in order to compile assembly code into binary.
If you are talking about user-space compilers then you should probably port an existing one (previously stated).
P.S. in that case take a look at self hosting.
Re: x86 binary reference
Posted: Tue May 23, 2017 8:37 am
by iansjack
Octacone wrote:I don't know what "create an assembler" means (I do, but that is not what you wanted to ask I guess).
I think that is exactly what the OP asked for; and he wants a reference to the opcodes to generate. That has now been answered.
Re: x86 binary reference
Posted: Tue May 23, 2017 9:12 am
by Schol-R-LEA
As it happens, just such an online x86 opcode database - in XML no less - does exist. I am intending to use it to generate the tables for my own assembler, and I think at least one other has used them in the past.
That having been said, me posting a link to it probably isn't a good idea, as it rewards the OP's laziness - it is not even a little bit hard to find that site with a Google or DDG search, or even a search on this very site (it has been mentioned on the forums before, and I think in the wiki, too) - and more importantly, bypasses a lot of the information they will need in order to use that database.
@ARISTOS, go and RTFM, then go look up that database. You absolutely need to do that if you are going write an assembler; trying to write one based solely on material you can read up on in a five-page tutorial or reference is futile. Trust me, I've been down that road; you aren't going to get anywhere without the manuals.
Re: x86 binary reference
Posted: Tue May 23, 2017 12:06 pm
by eryjus
Schol-R-LEA wrote:As it happens, just such an online x86 opcode database - in XML no less - does exist.
Nice find!!
Re: x86 binary reference
Posted: Tue May 23, 2017 1:11 pm
by Schol-R-LEA
I suppose, but it is hardly a new one. As I said, I and others have mentioned it here before, and the site has been around for at least five years that I know of (and the revision history says ten). A search on "x86 opcode" should find it quite easily - and by 'quite easily', I mean 'very first thing listed by both Google and DuckDuckGo', at least for the US versions.
In fact, just to make this point,
Let Me Google That For You. See?
http://ref.x86asm.net, right there. They even sell a printed version to go along with the free XML files.
I suspect that part of the problem here was that ARISTOS didn't know the best terms to search on. I am willing to give them the benefit of the doubt on this, actually, as the word 'opcode' isn't something even most programmers would think of.
But hiding it wasn't the point I was trying to make to ARISTOS.
Not doing that search, while not something that will endear ARISTOS to this group, isn't the real issue; the fact is that those listings, while extremely useful, are not a substitute for digging into the
Intel and
AMD manuals.
I will, however, add (shameless self-promotion alert) that
compilerdev page on
"Books and Papers" has a link to a complete
online book on developing assemblers and linkers, which, while dated, should be useful. Also, some of the compiler books cover the topic as well (most notably chapter 7 of
Modern Compiler Design).
Assuming, that is, that by 'create an assembler' the OP means they intend to develop a new assembler (or perhaps debugger), rather than (as has been suggested) wanting to write an assembly language program and looking for either an assembler or an assembly language tutorial. While I am pretty sure that ARISTOS is in fact planning on developing a new assembler, I could be wrong - a lot of people have come in here who had difficulty writing in English (sadly, many of the worst of these were native English speakers), or just didn't know what to ask.
It doesn't seem to be mentioned in the wiki, as I thought it was, so I'll
go correct that oversight right now.
Re: x86 binary reference
Posted: Tue May 23, 2017 9:05 pm
by LtG
The question the OP asked is clearly about x86 opcode reference (to create an assembler), not asking about assembly programming tutorials. If the OP had intended to ask about assembly tutorials then the question asked is the wrong one. I'm curious as to why so many decide to ignore the question and simply decide that the OP is asking about something quite different..
I decided to google the actual question: "x86 binary full reference with all details", now the first result points to this thread, second one is ref.x86asm.net and fourth is x86 instruction listing on Wikipedia which in it's references section has a link to Intel manuals. So really, before this thread existed it's likely that just typing the question into Google would have given immediate relevant results.
If one wants to split hairs about "with all details", then as far as I know such a thing doesn't exist. Bugs and optimizations vary in the Intel manual versions from year to year, so you'd have to read them all, they of course don't list undocumented opcodes (otherwise they would be documented, not undocumented), etc. But if one wants to create an assembler then these shouldn't really matter as assembler is supposed to do what the programmer asked, and for that the official specs from Intel and AMD should suffice quite well.
Re: x86 binary reference
Posted: Tue May 23, 2017 9:30 pm
by SpyderTL
Wow. I wish someone would have told me about this 8 years ago... before I WROTE MY OWN!

Re: x86 binary reference
Posted: Wed May 24, 2017 3:43 am
by dozniak
SpyderTL wrote:Wow. I wish someone would have told me about this 8 years ago... before I WROTE MY OWN!
Try googling some time. It's been available for over 10 years completely free of charge.
Re: x86 binary reference
Posted: Wed May 24, 2017 9:42 am
by Schol-R-LEA
True, but I don't think it has high a page rank* at the time. I am pretty sure I only ran across it around 2012, and I had certainly been looking for similar things in 2009.
Also, I noticed that I had bungled part of my first post, which made it even harsher than I intended and actually turned my point on it's head. ARISTOS might want to read the revised post, though my second post makes the point clearer anyway.
* (I was going to make a snide reference to '
SEO juice' (NSFW) when discussing page rank, but decided to put it in a footnote instead so as to avoid cluttering the actual point, especially since the footnote ended up longer than the rest of the post. And yes, he did notice that 'onisac' is 'casino' spelled backward; he wasn't going to give them even that much credit for cleverness, hence the low-blow raunchy jokes he actually made. Whether he knew that there actually is a 'Juicy Slots' isn't as clear.)