Thread: asm bin equivs

  1. #1
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    2,158

    asm bin equivs

    I know basic assembly, including that assembly isn't really a language as much as it is a human-readable representation of the binary bytes.

    The question is, does anyone know of a reference as to the assembly-binary equivilents?

    For example, 0xC5 is RET, and 0x03 is MOV. (I know I'm wrong, but you get the idea.)

    I could try to figure it out on my own with FASM and HexEdit, but a nice doc on it would be a lot less painful.

  2. #2
    & the hat of GPL slaying Thantos's Avatar
    Join Date
    Sep 2001
    Posts
    5,681
    You need to get the data sheet for the specific processor and it'll tell you.

  3. #3
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    http://www.intel.com/products/proces...uals/index.htm

    Op-codes are in the "instruction set reference". You could try out the AMD docs as well.

    gg

  4. #4
    Hacker MeTh0Dz's Avatar
    Join Date
    Oct 2008
    Posts
    111
    Quote Originally Posted by Yarin View Post
    I know basic assembly, including that assembly isn't really a language as much as it is a human-readable representation of the binary bytes.

    The question is, does anyone know of a reference as to the assembly-binary equivilents?

    For example, 0xC5 is RET, and 0x03 is MOV. (I know I'm wrong, but you get the idea.)

    I could try to figure it out on my own with FASM and HexEdit, but a nice doc on it would be a lot less painful.
    Your post is misleading.

    You are talking about the hexadecimal representations.

  5. #5
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,079
    Quote Originally Posted by MeTh0Dz View Post
    Your post is misleading.

    You are talking about the hexadecimal representations.
    What's the difference? Do you have trouble converting between bases?
    Sent from my iPadŽ

  6. #6
    Hacker MeTh0Dz's Avatar
    Join Date
    Oct 2008
    Posts
    111
    No I don't have trouble. I was simply saying that his post misleading.

    And there is obviously a difference, one is base 16 and the other is base 2...

  7. #7
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,079
    Quote Originally Posted by MeTh0Dz View Post
    No I don't have trouble. I was simply saying that his post misleading.

    And there is obviously a difference, one is base 16 and the other is base 2...
    Again... what's the difference? It's the same value regardless of the base it's written in. I'm a bit shocked that you're constructing an Operating System yet this is the first time you've encountered a conversation where one person speaks about binary but chooses to write the values in hexadecimal in order to make the statement more legible. Secondly, the OP mentioned looking up the codes in a hex editor which would do exactly what the OP did... take the machine code and convert it into hexadecimal to compact the data for reading. This is not a new concept.
    Sent from my iPadŽ

  8. #8
    Hacker MeTh0Dz's Avatar
    Join Date
    Oct 2008
    Posts
    111
    So you are arguing that his post isn't misleading?

    And this isn't the first time that I've seen people misuse, words when describing number bases. I am simply pointing it out.

    His statement is ambiguous, I don't see what exactly you are trying to argue.

  9. #9
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,079
    Quote Originally Posted by MeTh0Dz View Post
    So you are arguing that his post isn't misleading?

    And this isn't the first time that I've seen people misuse, words when describing number bases. I am simply pointing it out.

    His statement is ambiguous, I don't see what exactly you are trying to argue.
    I feel like I'm talking to a wall here... it's the same value regardless of the base. He could have written it in octal or decimal and it would have made just as much sense as long as he states what base he's writing in. When someone prefixes a value with "0x" it's hexadecimal. That's obvious... so why are you complaining what base he's writing in if the end result is the same value?

    Secondly... the two people that posted above you I know for a fact are very good programmers. They had no problem with the post for the same reason the I didn't and the OP didn't... because regardless of base, it's still the same value. Hell... if you even bothered looking at the Intel reference you'd see that they write the op codes in hexadecimal.
    Last edited by SlyMaelstrom; 11-15-2008 at 03:27 PM.
    Sent from my iPadŽ

  10. #10
    Hacker MeTh0Dz's Avatar
    Join Date
    Oct 2008
    Posts
    111
    Dude, you are not getting my point at all. Did I ever say that the value would be different when you change bases? No.

    I simply said that his wording was not explicit.

    And I never said I had a problem understand what he said, so don't imply that.

    Let me break this down.

    He says he wants to know the assembly-binary representation, which to me says he wants to know how to represent MOV in binary which would be, "00100...". Agreed? Because that is the binary representation.

    Then he goes on to show a hexadecimal representation of the MOV instruction, and says that he wants a document that would show all of the translations.

    That is ambiguous.

    Get my point?

    Also I've read the Intel manuals so you can stop implying that I don't know what I'm talking about at any time.

  11. #11
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,079
    I do believe that your posts imply that you don't know what you're talking about more than mine. Who cares if he asked for Binary representation... if we gave him decimal representation or hexadecimal representation... he would be fine with it because it's the same answer. THE SAME EXACT ANSWER.

    It's like Point-Slope form and Slope-Intercept form. It's the same thing written two different ways. The OP wants to go from a three letter assembly code to a machine op code, which have no logical conversion between each other. He doesn't really care what form you give him the op code in... as long as it can be converted to the form of his current needs, he would be satisfied.

    Listen... if he was asking for the conversion of a base to another base... and then wrote his example in a completely different base all together, then it would be ambiguous. However, in this case it's going from one value to a complete different type of value that can be written in an infinite number of forms.
    Last edited by SlyMaelstrom; 11-15-2008 at 03:50 PM.
    Sent from my iPadŽ

  12. #12
    Hacker MeTh0Dz's Avatar
    Join Date
    Oct 2008
    Posts
    111
    Did I ever say that a value can't be represented in an infinite number of bases and you would always get the same value? No.

    Please point out a place where it appears I don't know what I am talking about. As I doubt you will find one.

    Also, when you EXPLICITY say that you want to see the representation of a value in one base, which was binary. And then you show another reprentation in hexadecimal and say that you want a document on that. That is ambiguous.

    I'm not saying he couldn't get the document in any number base and then just do conversions.

    But the fact is those comments in themselves are ambigious to exactly what he wants. I don't see how I could be any more clear.

  13. #13
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    That is ambiguous.

    Get my point?
    Nope. Hex is often used as short-hand binary, there is absolutely 0 ambiguity here. That's like arguing with the computer because it says "blah is stored at address 0xF982FA20". If you explain why it's ambiguous then perhaps maybe, did you think "0x03" could be misinterpreted as binary?

    Perhaps you don't understand hex or it's purpose...

  14. #14
    Hacker MeTh0Dz's Avatar
    Join Date
    Oct 2008
    Posts
    111
    Wow.... Neither of you is getting my point.

    Also stop questioning whether I understand number bases, it's quite annoying.

    I am simply saying that it is ambiguous to request information in one number base and then give an example in another base and say you want it to be like that.

    Do you get that?

    Also I'm not saying that we don't know what he means, it is just that he wasn't explicit in spelling it out.

  15. #15
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    > Do you get that?
    No. It's widely understood that they can be interchangeably used, obviously no-one told you that.

    For example, is this ambigious?

    Code:
      0b0101
    + 0x5
    -----------
    I'd expect 99% if not 100% of programmers/computer scientists to be able to do that...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. adding a number to a number
    By bigmac(rexdale) in forum C Programming
    Replies: 11
    Last Post: 10-24-2007, 12:56 PM
  2. Bin packing problem....
    By 81N4RY_DR460N in forum C++ Programming
    Replies: 0
    Last Post: 08-01-2005, 05:20 AM
  3. My graphics library
    By stupid_mutt in forum C Programming
    Replies: 3
    Last Post: 11-26-2001, 06:05 PM
  4. Independent-Robert Fisk-Osama
    By a muslim in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 10-18-2001, 08:41 PM