Skip to main content
GameDev.net gamedev.net
🔒 Locked

x86 Instruction Notes

Started by disanti Jul 7, 2004 at 3:10 PM 3 replies 750+ views
Original Post
disanti
disanti
I have been looking at The Art of Assembler Language and found the topic: "Encoding x86 instructions". I found a bit of this information incorrect but cannot find a contact for the author of it so I started writing about it myself. If you find mistakes in it, please contact me: johndisanti[NOSPAMPLEASE]@santiproductions.com Here is what I have written so far: http://www.santiproductions.com/site/x86instruction.txt I have used NASM to assemble simple instructions, I then looked at the final file and wrote down the instruction's hex value. Now I have started converting the hex values to binary and finding patterns in them. Thanks, John DiSanti P.S. I know this may seem pointless but I need something to do this Summer so I decided on this.
My game development blog: http://rykerlabs.com
FenrirWolf
FenrirWolf
Hmm, interesting. I haven't read that book (?), so I'm not sure what part they got wrong.

Are you making a list of all the opcodes? For a modern CPU, that list looks to be about maybe quarter of all the available opcodes. Plus, there are FPU instructions and things like MMX, SSE, etc.

As for 32-bit mode, indeed most of the opcodes just need a 0xDD in front of them (when running from 16-bit mode). That's a trick I used to use with Borland Pascal's compiler to get it to generate 32-bit code, since its inline assembler wouldn't recognize the new opcodes. However, there are still 32-bit extensions to the original 16-bit set, like opcodes to load values into the global descriptor table and such. I'm a bit fuzzy on that, as I never got too much into doing protected mode assembly.
disanti
disanti
The Art of Assembler Language can be found here:
http://cs.smith.edu/~thiebaut/ArtOfAssembly/artofasm.html

I don't think I would be able to find every opcode! ;) I sure have learned a lot about how a computer works from this though.
My game development blog: http://rykerlabs.com
Sneftel
Sneftel
Intel's site has a PDF with a full listing of opcode translations.
disanti
disanti
Thanks! I didn't know that, I guess I have to find something else to work on. lol!
My game development blog: http://rykerlabs.com

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.