Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Feb 3, 2013, 12:18 PM   #1
ArtOfWarfare
macrumors 601
 
ArtOfWarfare's Avatar
 
Join Date: Nov 2007
Send a message via Skype™ to ArtOfWarfare
Intel x86 Programmer's Reference Manual? (HW)

I need to pick out 4 x86 instructions and explain the encoding that is used with each one. It's suggested that I find "Intel's Programmer's Reference Manual" to do this with.

I had another similar problem for Sun SPARC where I found this was helpful:
http://www.sparc.com/standards/V8.pdf

Pages 90 and 91 gave a very concise explanation of various commands like ldsb, ld, ldd, and so on.

I found this for Intel,
http://download.intel.com/products/p...ual/325462.pdf

I'm not sure if it's for the correct chip, and it seems to be anything but concise... I can't find anything in that manual that explains the encoding used for any instructions. Does anyone have a more helpful manual to look at (something that resembles the Sun SPARC manual I found, but for X86?)

Edit: Volume 1, Chapter 5 gives a list of instructions and brief explanations of what the instructions do, but then fails to explain the syntax that the person writing assembly code should use or the binary encoding that'll be used.
__________________
Battery Status - On the Mac App Store
The only app that'll estimate when your wireless devices will need their batteries changed.
Including the ones paired with other Macs on your network.

Last edited by ArtOfWarfare; Feb 3, 2013 at 12:24 PM.
ArtOfWarfare is offline   0 Reply With Quote
Old Feb 3, 2013, 12:51 PM   #2
chown33
macrumors 603
 
Join Date: Aug 2009
In that Intel doc, see Vol. 2, Ch. 2, Heading 2.1. The instruction-set encoding is insanely complex, with various prefixes and such, because it was gradually extended over a long period of time, from the original 8086. If you want something easier to decode, find a manual for the 8086.

I don't see a typical encoding table in the doc, probably because the instruction-set is too complex for that to be effective. Instead, I think you'll have to reverse-engineer a few instructions. The above Vol. 2, Sec 2.1 may be of use for understanding where things like addressing-mode field, operation field, operand size, etc. are placed. And some things are modal (an opcode may have different results in different modes).

Start by picking some of the basic operations, like ADC, ADD, AND. Look at the opcode byte. Figure out which bits change for each different operation, each addressing mode, etc. Once you have a basic pattern, look at other basic opcodes, like OR, SBB, SUB, XOR.
chown33 is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 01:33 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC