The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: EddieB on October 24, 2006, 03:45:12 PM

Title: Opcode List
Post by: EddieB on October 24, 2006, 03:45:12 PM
Hello,

Firstly, I wasn't to sure on where to put this, as there are many boards regarding the same topic :P

I need to obtain a ascii list of opcodes with there asm value. Ive found a few versions, but they need heavily sorting out. I was thinking along the lines of something like this:

0E PUSH CS
...

Cheers,Eddie
Title: Re: Opcode List
Post by: EddieB on October 24, 2006, 04:47:46 PM
http://83.170.74.3/OPCodeMatrix.csv

I just found that, but it doesn't contain the byte code for each one.
Title: Re: Opcode List
Post by: PBrennick on October 24, 2006, 05:36:23 PM
opmap.txt can be found in \masm32\help

You already have it...

Paul
Title: Re: Opcode List
Post by: EddieB on October 24, 2006, 06:45:48 PM
Haha, I knew that was there... I just didn't know it had the raw list.

Cheers man :)
Title: Re: Opcode List
Post by: Ehtyar on October 26, 2006, 10:21:31 PM
Well this is my kinda topic. I've been using the intel manuals for a long time, and lets just say i find it rather combersome. Unfortuately, i cannot find this opmap.txt you're speaking of, nor can i find it on google, other than this thread right here, and nither can two of my friends find it in their masm32\help dir. Would it be possible to attach this file for me please?

Thanks, Ehtyar.
Title: Re: Opcode List
Post by: hutch-- on October 26, 2006, 10:27:46 PM
 :bg

Its bveen there since 1998.


F:\masm32\help>dir opcodes.hlp
Volume in drive F is WIN2K_F
Volume Serial Number is F4D2-CDE7

Directory of F:\masm32\help

04/08/1998  07:38p              84,937 opcodes.hlp
               1 File(s)         84,937 bytes
               0 Dir(s)  16,278,241,280 bytes free
Title: Re: Opcode List
Post by: PBrennick on October 26, 2006, 11:32:32 PM
Ehtyar,
I have zipped up a copy of opmap.txt and attached it to this post. Don't mind Hutch, he gets like this every now and then.  :bdg

Hutch: He is looking for opmap.txt, not opcodes.hlp, it contains more information than the help file does. Evidently I must have added it to the help folder although I do not remember doing so. If I did, I have no clue how come EddieB was able to find it. Did this come with an older copy of masm32? :U

Paul


[attachment deleted by admin]
Title: Re: Opcode List
Post by: Ehtyar on October 27, 2006, 11:04:31 AM
aaaaHA, so this is the source of that memonix.exe. I can't imagine why anything so astoundingly useful would be removed from the masm package, I was considering unpacking memonix.exe to get the text file out of it, but seems you have saved me the trouble paul, thank you very much :)
Title: Re: Opcode List
Post by: PBrennick on October 27, 2006, 11:35:29 AM
Ehtyar,
One thing that I have always done is rename the masm32 folder instead of deleting it when I am going to install a new version. Then, I copy any files that appear to be missing into the new installation. Then, and only then, I will delete the old installation.

This is good advice for everyone. Do not let good stuff just disappear.
Paul
Title: Re: Opcode List
Post by: Ehtyar on October 27, 2006, 12:02:05 PM
I just paste everything over the top, so any files not in the new version are still left behind, and if any of the new files I don't like, just replace 'em from the old installation. But you must remember, I've been using masm for a lot less time than yourself paul ;)

Speaking of which though, is there an masm archive kinda thing anywhere?
Title: Re: Opcode List
Post by: EddieB on October 27, 2006, 12:04:16 PM
Thanks PBrennick...

I didn't have it in my masm32 folder either, I copied them out of the help file in the end :P

Cheers,
Title: Re: Opcode List
Post by: PBrennick on October 27, 2006, 12:48:38 PM
EddieB,
Thanks for the info. As you can see, opmap.txt is more imformative.

Ehtyar,
I have never seen any such archive. I have a copy of every version I ever installed. They are strewn all over the place so you may have better luck asking Hutch directly. If he wont help you, then come back to me but it is appropriate to ask him first.

Paul


Title: Re: Opcode List
Post by: EddieB on October 27, 2006, 12:56:29 PM
PBrennick,

Yeah, Since you posted the ascii list, im using it :)

The layout is exactly what I need for this decompiler.
Title: Re: Opcode List
Post by: drizz on October 27, 2006, 03:44:12 PM
this little prog. is also nice because you can sort columns by opcode & by mnemonic
http://www.masm32.com/board/index.php?action=dlattach;topic=62.0;id=51
Title: Re: Opcode List
Post by: EddieB on October 27, 2006, 04:33:17 PM
Cool...

But would be even better if you could export the new layout...;)
Title: Re: Opcode List
Post by: PBrennick on October 27, 2006, 05:20:40 PM
EddieB,
By the end of the weekend, I will have completed a program that sets up the file as a cardfile. I am almost done reformatting the file into fields. Once that is done it will be very easy to sort it in any way.

Paul
Title: Re: Opcode List
Post by: EddieB on October 27, 2006, 06:24:18 PM
Ah cool :)

I'll keep an eye open for it.
Title: Re: Opcode List
Post by: PBrennick on October 27, 2006, 08:17:54 PM
EddieB,
I am creating 5 fields as follows:

Mnemonic
Opcodes
Register/Memory usage
Description
Minimum CPU requirement

Paul
Title: Re: Opcode List
Post by: Vortex on October 27, 2006, 08:18:24 PM
Hi Paul,

That's going to be a nice tool :U
Title: Re: Opcode List
Post by: EddieB on October 27, 2006, 08:37:06 PM
Nice one!

Can't wait :)
Title: Re: Opcode List
Post by: Ehtyar on October 27, 2006, 08:39:13 PM
WOW this is an awesome thread, thanks for the tools Paul and Drizz, definately looking foreward to your re-work Paul :D
Title: Re: Opcode List
Post by: PBrennick on October 27, 2006, 09:13:12 PM
Thank you all for your nice words, I have been working on the text file database all day and your words make these efforts seem worthwhile.

Because I want others to easily use this database I am embedding the field specifiers

Here is an example of what you will see:

fld1=IMUL
fld2=69 /r iw
fld3=r16, imm16
fld4=word register=r/m16 * immediate word
fld5=386

The included CardFile example will show how the database can be accessed. The CardFile example is finished, I just need to finish conditioning the database.

Paul
Title: Re: Opcode List
Post by: EddieB on October 27, 2006, 09:14:51 PM
Yeah thats awesome :)

I can tokenise it easier like that.
Title: Re: Opcode List
Post by: Ehtyar on October 27, 2006, 09:27:42 PM
I'll second that :) :U
Title: Re: Opcode List
Post by: hutch-- on October 28, 2006, 03:32:43 AM
I finally tracked the file down, it was nested three deep in a directory and I had for gotten its name. It was never part of the MASM32 project, I had posted it about 2 years ago or so in the masm forum. Paul has posted it so there is no point posting it again. It was up to date a couple of years ago but it does not include the SSE3 instructions.
Title: Re: Opcode List
Post by: Ehtyar on October 28, 2006, 11:54:55 AM
I only use the standard ones and ocasionally some fpu ones, so this thing is awesome :)

P.S. Hutch, check pm :)

Regards, Ehtyar.
Title: Re: Opcode List
Post by: EddieB on October 28, 2006, 01:16:25 PM
Ill I need is:

NAME | OPCODE | LENGTH TO FOLLOW
Title: Re: Opcode List
Post by: PBrennick on October 28, 2006, 02:22:23 PM
EddieB,
That is the nice thing about my version, you can pick and choose what fields to use. In your case, you would use the first 3 fields.  By the way, my version DOES include SSE3.

Paul
Title: Re: Opcode List
Post by: EddieB on October 28, 2006, 02:30:41 PM
Awesome :)

Any preview yet?
Title: Re: Opcode List
Post by: PBrennick on October 28, 2006, 06:05:51 PM
EddieB,
The list is complete, but the docs had errors (flag errors, if you can believe that!). So I am slowly going through the list and comparing the stuff against my QUE manual. It probably wont be done until tomorrow. I have put over 14 hours into it already but I want it to be correct.

I have completed the repair of almost 9,000 bytes of the file which will be over 100,000 bytes when completed. I am attaching the completed section so you can start writing your software to access it. Whatever works with the preview will, of course, work with the final product. If it is not proprietory, show us YOUR sources when you are done. My CardFiler needs lots of work as it takes about 5 seconds to parse the complete database. I am embarassed.

EDIT: I am attaching the early version of the CardFile program so you can see how I chose to access the database. Please do not be TOO critical, I know it sucks but the database is taking ALL of my time right now. If you do not use GeneSys just replace that word with masm32 and it will build fine (.rc, .asm and .bat all use the GeneSys hardcoded path).

EDIT: Both attachments have been updated. There are 323 records in the preview.

Paul


[attachment deleted by admin]
Title: Re: Opcode List
Post by: EddieB on October 28, 2006, 09:11:20 PM
Ha! That's perfect...

The text file is exactly what I needed, many thanks again and again :)

That makes it 100% easier to parse.

Cheers
Title: Re: Opcode List
Post by: Ehtyar on October 28, 2006, 09:56:53 PM
Jeez Paul, don't be so hard on yourself. Coders will be worshiping you for this for years to come, myself included no doubt!!
Title: Re: Opcode List
Post by: PBrennick on October 28, 2006, 10:05:23 PM
Ehtyar,
You are a very nice man. Thank you.

Everyone: I will post another update tomorrow morning and then every 3 or 4 hours after that. It is slow going but as you can see from the preview, it is well worth it. I am parsing the FPU stuff right now and watching Florida creaming Georgia.  :bdg

It does not look like I will finish tomorrow, that was an optimistic prediction, evidently, but I will keep the updates coming until it is done. My realistic goal for tomorrow is to get 500 records into the preview file. Wish me luck!

Paul
Title: Re: Opcode List
Post by: Ehtyar on October 28, 2006, 10:43:08 PM
Indeed, good luck Paul. This is a massive undertaking, YOU are the nice man i think :U
Title: Re: Opcode List
Post by: EddieB on October 29, 2006, 12:54:26 AM
Just wondering, why are you doing it by hand? Surely it would have been easier to write an application that takes the list and splits it into groups of four..
Title: Re: Opcode List
Post by: Ehtyar on October 29, 2006, 01:09:25 AM
I actually tried that myself with a little regex, but it dosnt work because of the varying lengths of the different columns :(
Title: Re: Opcode List
Post by: EddieB on October 29, 2006, 01:20:32 AM
Well, the ascii copy I have, each one is on a new line.... So I would split it up into lines and go from there.
Title: Re: Opcode List
Post by: Ehtyar on October 29, 2006, 01:26:42 AM
meh, mine must be different....
Title: Re: Opcode List
Post by: EddieB on October 29, 2006, 01:31:38 AM
I would use C++ for it though :P I'm still a bit of a "noob" in asm, but I know enough to get me by.
Title: Re: Opcode List
Post by: Ehtyar on October 29, 2006, 01:42:51 AM
I prefer asm for almost everything, it just makes so much sense to me. C++ on the other hand is just voodoo to me, lol, thought i do appreciate the occasional C.

P.S. We so need instant chat, IRC anyone? :P
Title: Re: Opcode List
Post by: EddieB on October 29, 2006, 01:45:17 AM
Yeah, im not going to start a debate here over C or C++ :P I don't just use C++, I use both... I just like to say C++ :P
Title: Re: Opcode List
Post by: Ehtyar on October 29, 2006, 01:51:37 AM
LOL, sounds more impressive i must admit. What i really miss most in hlls is access to the registers, a mile long list of varibles instead of a push eax here and pop edx there.
Title: Re: Opcode List
Post by: EddieB on October 29, 2006, 01:56:43 AM
I do use a lot of asm in my C++.

For example:

void *functionptr = GetProcAddress(....

_asm{
    push arg1
    push arg1
    ...
    call functionptr
}

Does save me a lot of time.
Title: Re: Opcode List
Post by: Ehtyar on October 29, 2006, 01:58:54 AM
*nods* Out of curiosity, what langauges can you code and in which order did you learn them?
Title: Re: Opcode List
Post by: EddieB on October 29, 2006, 02:21:42 AM
I started of in basics, now im onto C++ and ASM...

I know various other languages such as PHP, VB and anything else I can find...

I'm currently working on this with its creator, ( nuclearglory.com ) Nuclear fusion is a C++ game engine, Nuclear basic is a basic language soon to be released, and the collision dll is what ng is well known for.

Well that's a bit about me.

Cheers
Title: Re: Opcode List
Post by: PBrennick on October 29, 2006, 03:39:24 AM
You guys sound bored. I DID use an application to spit the lines (TextPad), then I used TextPad to add the prefixes. Now I am doing the editting. The way you could write anapplication to split the columns is to search for 2 consecutive spaces. When you find a match, you replace the spaces with a CRLF pair. Easy when you know how, right? This breaks up the fields correctly but puts spaces at the beginning of some lines. Using TextPad, you can use a Regular Expression search for the beginning of any line with a space and replace it with nothing. Then you just keep pressing Replace All until it fails. Then add the prefixes, save the file and make a coffee.

There are now 307 records in the preview.
Paul
Title: Re: Opcode List
Post by: Ehtyar on October 29, 2006, 04:07:19 AM
My first language was mirc script, which taught me most of the basic programming concepts, varibles, if statements etc, then i went on to html, php, vb, various scripting languages, before i found assembly. I then moved on to some more advanced hhls like c/c++/delphi, i swear to god though i will never touch .net again unless im making money out of it, lol.
Title: Re: Opcode List
Post by: Ehtyar on October 29, 2006, 04:09:26 AM
Bored is the word Paul, lol. If i'm not careful i'll break my 100 posts. Right now im setting up a 64 bit machine with windows and office (god 64 bit sucks).
Im glad that you're not doing it all by hand, i feel a lot better now :) Please let us know if we can be of any help at all.

Regards, Ehtyar.
Title: Re: Opcode List
Post by: PBrennick on October 29, 2006, 05:01:16 AM
Thanks for the offer but I am all done with the formatting. I just need to look at each record for errors. I am also shortening the explanation field of each record to try to cut down on the file size. I was considering breaking it up into the various CPU settings but I like the idea of keeping it all in one file. The best way you can help is by making a nice program that utilizes the database.

Paul
Title: Re: Opcode List
Post by: Ehtyar on October 29, 2006, 05:24:26 AM
The only language i know in which i can manipulate strings well is php :( Maybe one day in the future i'll be good enough at asm to accomplish something worthy of this creation of yours.
Title: Re: Opcode List
Post by: PBrennick on October 29, 2006, 01:21:50 PM
Ehtyar,
I am certain you will accomplish this. If you start a project using my database and need help, post your questions in GeneSys as that is where I spend most of my time.

I am building this database in the Campus because I want everyone to see this nice database. I am going to go back to work on it now. I got a late start because I found a serious problem with the new version of masm32 and needed to do a lot of quick testing this morning.
Be sure to read the thread I just started in the Campus.

I am going to start a thread about this project in GeneSys so watch there for the next updates.

Paul
Title: Re: Opcode List
Post by: EddieB on October 29, 2006, 02:00:00 PM
Ah yes, I understand now....

I started like this:

Basic HTMLWebpages
Basic languages ( Blitz, qbasic etc )
PHP ( and other server side languages )
C and C++
Advanced C++ Stuff like templates etc.
ASM ( recently )
Title: Re: Opcode List
Post by: PBrennick on October 29, 2006, 04:06:20 PM
Okay,
I am up to 364 records now and I am done with the FPU stuff. I will now post the update in GeneSys and continue from there.

Paul