flat assembler
Message board for the users of flat assembler.

Index > Projects and Ideas > [draft] New complete x86 and x87 reference

Goto page 1, 2  Next
Author
Thread Post new topic This topic is locked: you cannot edit posts or make replies.
MazeGen



Joined: 06 Oct 2003
Posts: 954
Location: Czechoslovakia
MazeGen
News: This project was reborn, refer to http://ref.x86asm.net

Hi all,

Here is a draft of a new complete x86 and x87 reference, made out by me. It should be useful as general opcode and instruction reference. It is intended originally as a quick and complete reference for coding an advanced disassembler.
It should be quicker than, for instance, Intel manuals, because it should cointain (almost) all important informations about an opcode or an instruction in one row.
It should also clearly present the differencies between x86-32 and x86-64 instruction set.

When it will be complete, I'm planning to release it in public domain, and therefore I'd like to discuss it in this draft stage. Your comments and corrections are welcomed.

The document is attached. After download, change its extension to .htm.
It can be seen also on-line here: outdated link removed
(Note that the hosting made a few dirty tricks with the html source, but it is still well browsable.)

In this draft I tried to show the most important features of the reference. I don't plan any surprising news at the moment.

As for media, it is intended for both on-line, off-line and printable version. I tried to print this draft and it seems to be well readable.

As for blanks rows, here are missing opcodes that will be added in the final version.

Not implemented features yet:
The following feature was added in version 0.4a:
MazeGen originally wrote:

The printable version could be formatted differently (white backgroud etc.). It would be obtainable using a hypertext reference, which will make printable version using different CSS.


Notes about browsers are inside the reference from version 0.4a.
MazeGen originally wrote:

As for browsers:
I recommend Firefox 1.5 or Opera 8.52.
Internet Explorer 6.0 doesn't support some features and therefore the table doesn't contain any thick borders. Hopefully, new version 7.0 will be better.


As for HTML code:
The document validates as HTML 4.01 Strict and also as CSS 2. It is as simple as possible. I wrote it by hand. Note I'm not HTML coder.
The table is formatted using <table> element. Each opcode and opcode extension uses <tbody> element. Each row uses <tr> element.


Description: After download, change the extension to .htm.
Download
Filename: newopcodes04a.txt
Filesize: 101.48 KB
Downloaded: 1423 Time(s)



Last edited by MazeGen on 05 May 2008, 12:32; edited 6 times in total
Post 01 Mar 2006, 09:42
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 16847
Location: In your JS exploiting you and your system
revolution
FS and GS are valid in P4+

Opcode 0F (pop cs) I think is not documented anywhere and I am sceptical about whether it actually works in the 8086. Certainly every later processor will generate an exception or it becomes the two byte opcode.

Overall a good effort.
Post 01 Mar 2006, 12:39
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7415
Location: Kraków, Poland
Tomasz Grysztar
revolution wrote:
I am sceptical about whether it actually works in the 8086.

Nevertheless, it does. Wink
Post 01 Mar 2006, 14:01
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7106
Location: Slovakia
vid
Tomasz: have YOU tried it?
Post 01 Mar 2006, 14:39
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
MazeGen



Joined: 06 Oct 2003
Posts: 954
Location: Czechoslovakia
MazeGen
I've uploaded fixed version.

As for FS and GS: yeah, it's a bug, but they are 386+. Fixed.

As for POP CS, I have added it for fun, but it is documented in opcode.lst by PHG. I remember we discuss it already in some thread in Compiler internals subforum. I have added the source into the document.
Post 01 Mar 2006, 14:47
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7106
Location: Slovakia
vid
good thing, i was missing good fast description WITH FLAGS. thanks
Post 01 Mar 2006, 15:05
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Reverend



Joined: 24 Aug 2004
Posts: 408
Location: Poland
Reverend
Nice thing but you have to browse through whole description at first to get the idea what is what. But it's a good work. Some time ago, when I was coding my Length Disassembly Engine I was looking for something similar and ended up jumping from AMD and Intel manuals Smile
Post 01 Mar 2006, 15:29
View user's profile Send private message Visit poster's website Reply with quote
MazeGen



Joined: 06 Oct 2003
Posts: 954
Location: Czechoslovakia
MazeGen
Reverend wrote:
Nice thing but you have to browse through whole description at first to get the idea what is what.

Yes, you have to get familiar with it first. The columns have to be compressed as far as possible, otherwise the row lenght would be too long and the document would get unprintable (and unreadable).
Reverend wrote:
Some time ago, when I was coding my Length Disassembly Engine I was looking for something similar and ended up jumping from AMD and Intel manuals Smile

Exactly: 1. These manuals are huge. 2. The Opcode Map is too brief. 3. The Instruction Reference is too detailed Smile

And thanks for your kind words, guys Smile
Post 01 Mar 2006, 15:41
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7106
Location: Slovakia
vid
acording to what does bitwise instructions (XOR, OR) set carry or overflow flag? is it just original value compared to result?

btw, shouldn't this be in Main section? I am not sure if this can be called "project", it's done anyway.
Post 01 Mar 2006, 22:28
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
MazeGen



Joined: 06 Oct 2003
Posts: 954
Location: Czechoslovakia
MazeGen
That's exactly the right quick question for the reference. Just look, for instance, at OR mnemonic:
Code:
tested f modif f  def f    undef f  f values
         o..szapc o..sz.pc .....a.. o......c
    

You'll see that f values column contains o......c, what means 0F and CF are always set to some specific value. These flags are lower-case, what means these are always set to zero.

I'd like to see it in the Main subforum because of more readers. And the project is not done, I'm still willing to modify it according to your comments and suggestions.
Post 02 Mar 2006, 06:26
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7106
Location: Slovakia
vid
oh.. "undefined" flag means that flag value after instruction cannot be determined?
Post 02 Mar 2006, 08:40
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2145
Location: Estonia
Madis731
Yeah, too bad it can be viewed only at 1600x...
I tried on 1152x... but I had to smallen (Ctrl+"-") two times to fit the width.

There are two #r_note1 and "instruction extensions opcodes" goes no-where Wink
btw, what does "<img src="newopcodes01a_files/a.gif" alt="" align="right" height="1" width="1">" do?

Couldn't you make the "description, notes" two lines or something so it would grow in length not width. Maybe replace binary=bin, decimal=dec, general=gen, logical=log, etc.
With "po" 06 and 07 you have two multilined rows, you can make 41 multiline too and the 0F 10..12. Otherwise its great and I'm out of ideas Smile

Maybe you can add some CSS-style to the tables so you can hover and highlight the rows.
Oh, you can put a <title> tag in the notes and it will be displayed like the image shows:

I'll also post the version with <title> tags:

EDIT: I deleted the old version to preserve space


Description: tag in the link (demo in Seamonkey 1.0) that should work flawlessly in any browser.
Filesize: 994 Bytes
Viewed: 16456 Time(s)

Title-tag.png



_________________
My updated idol Very Happy http://www.agner.org/optimize/


Last edited by Madis731 on 08 Apr 2006, 21:29; edited 1 time in total
Post 02 Mar 2006, 08:42
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
MazeGen



Joined: 06 Oct 2003
Posts: 954
Location: Czechoslovakia
MazeGen
vid wrote:
oh.. "undefined" flag means that flag value after instruction cannot be determined?

Exactly. (in case of OR instruction and Adjust Flag it is nothing weird though)
Post 02 Mar 2006, 10:35
View user's profile Send private message Visit poster's website Reply with quote
MazeGen



Joined: 06 Oct 2003
Posts: 954
Location: Czechoslovakia
MazeGen
Hi Madis, thanks for your comments Smile

Madis731 wrote:
Yeah, too bad it can be viewed only at 1600x...
I tried on 1152x... but I had to smallen (Ctrl+"-") two times to fit the width.

I, personally, use 1024x768. I start from the fact that for most of the users is the description almost needless, because the reference is not intended for beginners. Using 1024x768, you can see all but the description.
And yes, one can always scale it down in the browser.

Madis731 wrote:
There are two #r_note1 and "instruction extensions opcodes" goes no-where Wink

Thanks, fixed.

Madis731 wrote:
btw, what does "<img src="newopcodes01a_files/a.gif" alt="" align="right" height="1" width="1">" do?

This weird, not valid line is added by the hosting probably because of a counter or something Evil or Very Mad The hosting also automatically edites the charset to windows-1250 Evil or Very Mad
Therefore you should always use the attachment.

Madis731 wrote:
Couldn't you make the "description, notes" two lines or something so it would grow in length not width.

I don't want do alocate more than one row for one opcode, only in cases when it is neccessary, because it will be too long. As I said, the description is rather marginal.

Madis731 wrote:
With "po" 06 and 07 you have two multilined rows

I changed it to single row now.

Madis731 wrote:
you can make 41 multiline too

Why?

Madis731 wrote:
Maybe replace binary=bin, decimal=dec, general=gen, logical=log, etc.

Your right. I have made the Main Group six-char (I can't shorten x87FPU more):
Code:
prefix - pref
general - gen    


I was thinking about it, but how to shorten the following names and let the name still readable at the same time?

From Sub-group:
Code:
shftrot
simdint
mxcsrsm
pcksclr    


From Sub-sub-group:
Code:
shunpck    

Madis731 wrote:
Maybe you can add some CSS-style to the tables so you can hover and highlight the rows.

Yes, I'd like to add it, you mean something like this?

Madis731 wrote:
Oh, you can put a <title> tag in the notes and it will be displayed like the image shows:

Good idea, added.

I'll update the attachment and the on-line version in a few minutes.
Post 02 Mar 2006, 11:21
View user's profile Send private message Visit poster's website Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2145
Location: Estonia
Madis731
Mazegen wrote:

Madis731 wrote:
Maybe you can add some CSS-style to the tables so you can hover and highlight the rows.

Yes, I'd like to add it, you mean something like this?

Yeah, exactly. It doesn't matter weather its darker or brighter - just different Smile

_________________
My updated idol Very Happy http://www.agner.org/optimize/
Post 02 Mar 2006, 11:39
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
MazeGen



Joined: 06 Oct 2003
Posts: 954
Location: Czechoslovakia
MazeGen
Original post edited, new revision released: Very nice browsing feature - hover to highlight the row Smile

(Works only with Firefox, but the solution is valid. Opera probably contains some bug.)
Post 03 Mar 2006, 09:19
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 16847
Location: In your JS exploiting you and your system
revolution
Highlights don't work with IE6.0 either.
Post 03 Mar 2006, 11:43
View user's profile Send private message Visit poster's website Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2145
Location: Estonia
Madis731
Works under Mozilla AS 1.7.12, Seamonkey 1.0, IE 7.0 beta 2 (extremely slow), Firefox 1.5.0.1.
Tables don't work under IE6 as you mentioned - maybe they have broken CSS Sad and loads very slow (2-3 seconds from cache) on my 3GHz P4 HT.

I don't have Opera, I have no idea why doesn't it support CSS2 - did you try the latest?
Post 03 Mar 2006, 11:58
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
MazeGen



Joined: 06 Oct 2003
Posts: 954
Location: Czechoslovakia
MazeGen
revolution:

I know, but it shouldn't be so difficult to open the reference in Firefox, even if you don't have Firefox as a default browser. I hope IE 7.0 (coming soon) will be useful (and not slow).

Madis:

IE 6.0 lacks very many CSS features. I use much slower computer than you in these days and my IE 6.0 loads it as quick as Firefox.

As for Opera, I have the latest version (8.52) and it has nice CSS support, but there is probably some bug with the hover pseudoclass Sad
Post 03 Mar 2006, 14:29
View user's profile Send private message Visit poster's website Reply with quote
MazeGen



Joined: 06 Oct 2003
Posts: 954
Location: Czechoslovakia
MazeGen
Original post edited, new revision released.

The reference is now divided among main parts. For navigation, there are references to these parts also at the beginning.
Main new feature is complete support for printing, with how-to-print instructions and notes. In order to get nice printer layout, any opcode extension gets its own row (see opcodes 80, 82, C0, D8, DB, 0F00, and 0F01). It seems to be better readable now, at least for me. Any part (and also notes below the tables) starts at new page.
Post 06 Apr 2006, 15:52
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic This topic is locked: you cannot edit posts or make replies.

Jump to:  
Goto page 1, 2  Next

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2019, Tomasz Grysztar.

Powered by rwasa.