Thread: asm bin equivs

  1. #16
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,079
    Quote Originally Posted by MeTh0Dz View Post
    I don't see how I could be any more clear.
    There is nothing unclear about what you're saying... it's just a pointless remark. The fact that he suggested binary representation and then went on to show hexadecimal in his example only shows that he doesn't care what form you give him the answer. You're pointing out something completely irrelevant and trying to claim that it would lead people to giving bad information. The fact is that any which way his point might lead someone to answer... the answer is still going to be correct, just in a different form.

    It's been completely apparent since your first post that you're just nitpicking. However, instead of actually nitpicking a genuine flaw, you're just nitpicking a choice of words that ultimately have no relevance to the content of the question asked.

    I mean after reading two responses that answered his question correctly... do you honestly believe anyone was mislead by the question?
    Sent from my iPadŽ

  2. #17
    Hacker MeTh0Dz's Avatar
    Join Date
    Oct 2008
    Posts
    111
    That's not even CLOSE to the same thing.

    A more accurate example is me saying.

    "Give me the binary representation of 5".

    And you responding with.

    "0x5"

    As opposed to.

    "0b00000101"

    I never said anyone was confused, I was just saying for the sake of the OP and furture reference that his post wasn't as explicit as it could have been.

    Clear?
    Last edited by MeTh0Dz; 11-15-2008 at 04:15 PM. Reason: SlyMaelstrom Posted

  3. #18
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,079
    Quote Originally Posted by MeTh0Dz View Post
    Clear?
    No, not at all... because that's not what he was asking and that is apparent to everyone including yourself. If he himself used hexadecimal in his own examples, as you so intelligently identified... why do you think he would care what representation the solution is in?

    Zacs7 example was spot on... if someone were to ask you to solve:

    Code:
    0x7 + 3
    It wouldn't matter if you answered 10 or 0xA because the question implies that the form of the solution is allowed to be ambiguous.
    Quote Originally Posted by MeTh0Dz View Post
    I never said anyone was confused
    Yes, you did... you said "The post is misleading" and then directly reiterated the point two more times. This implies that you believe the question could lead someone to misunderstand the question and lead them to answer the question incorrectly. This is a forum, kid... everything you write is being recorded.
    Last edited by SlyMaelstrom; 11-15-2008 at 04:21 PM.
    Sent from my iPadŽ

  4. #19
    Hacker MeTh0Dz's Avatar
    Join Date
    Oct 2008
    Posts
    111
    Like I said Zacs7 example doesn't apply. Look at my example if you want to see one that accurately depicts the situation.

    Also, if he is using multiple bases you could assume that, or you could just assume that he misworded things. Or you could assume the former and then point out that his wording wasn't explicit.

  5. #20
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    Then perhaps you could have told the OP that "0x03" is not in binary. Which they probably already know... but stop and think what it represents first (and does a good job of doing so!)

    In comparison, if there was a question:

    "Give me the address of 5 from this memory diagram"
    If you answered "0x59" that's perfectly correct, as is 001011001, as is 0o131, so on. You've said before, any number can be respresented in the infinite bases.

  6. #21
    Hacker MeTh0Dz's Avatar
    Join Date
    Oct 2008
    Posts
    111
    Indeed you could use any base you wanted to represent the location.

    But did you anywhere in the question ask explicitly for a certain number base? No.

    Therefore you are not accurately recreating the situation.

  7. #22
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,079
    Quote Originally Posted by MeTh0Dz View Post
    Also, if he is using multiple bases you could assume that, or you could just assume that he misworded things. Or you could assume the former and then point out that his wording wasn't explicit.
    Yeah let's assume that a guy who claims knowledge of both assembly and hex editors doesn't know that 0xC5 isn't binary.

    I think you've dug this hole deep enough and I believe if Yarin is satisfied with the solution provided by CodePlug then this discussion should be closed.
    Sent from my iPadŽ

  8. #23
    Hacker MeTh0Dz's Avatar
    Join Date
    Oct 2008
    Posts
    111
    Dug this hole? Hmm..

    Did I ever say that he didn't know anything? I just said his wording was ambiguous.

  9. #24
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    Sigh, abandon ship. Let it sink to the bottom, we'll go party on "hex island".

  10. #25
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    Quote Originally Posted by MeTh0Dz View Post
    Your post is misleading.
    You are talking about the hexadecimal representations.
    This is just an argument of semantics. In practice, it's common to refer to things such as opcodes as 'binary' - it's not a matter of base representation but of the particular format of the data (ie: raw machine code).
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

  11. #26
    Hacker MeTh0Dz's Avatar
    Join Date
    Oct 2008
    Posts
    111
    Sure it is an argument of semantics, phrasing, word choice, etc.

    I'm not saying that it is a huge deal, but regardless I do have a valid point, which people seem to not be able to grasp.

    But continue..

  12. #27
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    Again, your point may be *semantically* correct, but it is *practically* moot. Everyone here knows what the OP meant. There is no ambiguity. At any rate, the original question has been answered. Can we move on now, please?
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

  13. #28
    Hacker MeTh0Dz's Avatar
    Join Date
    Oct 2008
    Posts
    111
    Sure.... But there is inherent semantic ambiguity even by following your statement. But at any rate let's move on. I thnk everyone's thoughts are clear.

  14. #29
    Registered User
    Join Date
    Sep 2001
    Posts
    4,912
    Thread closed. If anybody has anything further to contribute to the thread, please PM a mod.

    You can probably find a reference in the back of a good assembly book. Mine has all the instructions, but it doesn't talk about everything you need to know for the conversion process. It doesn't mention how operands get coded, etc..

    Incidentally, my book is published by IBM, and the appendix is titled "Binary Equivalents" and the op-codes are printed in hexadecimal - the reason being that the point of having the op-codes is accomplished whether you use binary or hexadecimal. The computer uses binary, but the human has an easier time reading hexadecimal for most purposes - and so the terms are used somewhat interchangeably in that particular application.

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