What is binary code?

This is a discussion on What is binary code? within the A Brief History of Cprogramming.com forums, part of the Community Boards category; What is binary code?...

  1. #1
    Registered User
    Join Date
    Oct 2001
    Posts
    101

    What is binary code?

    What is binary code?

  2. #2
    Former Member
    Join Date
    Oct 2001
    Posts
    955
    are you kidding?

    Oskilian

  3. #3
    31173 h4x0r gnu-ehacks's Avatar
    Join Date
    Nov 2001
    Posts
    556
    01000111001101011010111010101101010100011011101010 1101010101010101.

    Basically, arcane giberish that even super computer geeks have trouble understanding. When you compile a .cpp file, it is converted to a .o file, or a binary file. After that, the .o files are linked to form a .exe file. Binary code is just 0's and 1's that turn bits on and off.
    What will people say if they hear that I'm a Jesus freak?
    What will people do if they find that it's true?
    I don't really care if they label me a Jesus freak, there is no disguising the truth!

    Jesus Freak, D.C. Talk

    -gnu-ehacks

  4. #4
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,230
    Actually, binary code is a bunch of opcodes which are fed to the CPU. Opcodes are instructions in hex (Good God! you thought they were in binary!? try typing 04C6A23h out in binary...fun, huh?) telling the CPU what to do.

  5. #5
    Sayeh
    Guest
    There is only binary. All the chip sees is binary. All information, code, etc. is reduced to binary on your computer, which is essentially TTL logic in software.

  6. #6
    Hamster without a wheel iain's Avatar
    Join Date
    Aug 2001
    Posts
    1,385
    it is true - all internal systems work in binary, (1,0) (on, off) (true, false) but in the end they are all 1's and 0's. Hex was developed because the human brain is unable to understand the binary coding as we work in "logical" base 10.
    Monday - what a way to spend a seventh of your life

  7. #7
    _B-L-U-E_ Betazep's Avatar
    Join Date
    Aug 2001
    Posts
    1,412
    in unix, a binary is an executable code or rather is not an ASCII text file. zips, executables, etc are all binaries.

    just more info in excess of what has been already given. (though the object file isn't a binary really because it doesn't really have any executable properties)
    Blue

  8. #8
    Registered User
    Join Date
    Nov 2001
    Posts
    202
    Is it possible to "read" binary code?
    like does it follow a pattern or some way to translate it to english?

  9. #9
    Blank
    Join Date
    Aug 2001
    Posts
    1,034
    All the complicated details are covered under the intel instruction manual.



    To decode convert the first byte into hex. Then look it up in appendix C.

    Then you might have to go further if it's 0f or you might have to mess around with the ModRM byte or it might be 66. You are best off running the program and then describing it in english.

  10. #10
    31173 h4x0r gnu-ehacks's Avatar
    Join Date
    Nov 2001
    Posts
    556
    Yeah, ken, binary = 2. It is a base two number system. 0's and 1's. Processors are fed binary and not hexidecimal. Processors use things called transistors, which work with 2 kinds of current, no current, and some current. Therefore, processors work in 0's and 1's. Although in ASM, hex is used a lot, you still compile it into an object file.
    What will people say if they hear that I'm a Jesus freak?
    What will people do if they find that it's true?
    I don't really care if they label me a Jesus freak, there is no disguising the truth!

    Jesus Freak, D.C. Talk

    -gnu-ehacks

  11. #11
    Registered User
    Join Date
    Oct 2001
    Posts
    22
    Originally posted by Isometric
    Is it possible to "read" binary code?
    like does it follow a pattern or some way to translate it to english?
    yeah, its asm. If you really want to be more technical

    addr | instr l/r mode index left right
    0000 100011 1 101 00 01 00

    instr 6-bits the instruction to use, in this case mov
    l/r 1 bit used for indexing
    mode 3 bits addressing mode of the operation
    index 2 bits what register the index is applied to (if any)
    left 2 bits what is on the left of the operation
    right 2 bits what is on the right of the operation

    thus, this would convert to the asm code

    mov eax, [ebx];

    compacted all together

    addr | code
    0000 10001111 01000100

    of course this only works with a 16-bit processor

    confused?

    -Vulcan
    Last edited by Vulcan; 12-04-2001 at 02:58 AM.

  12. #12
    Hamster without a wheel iain's Avatar
    Join Date
    Aug 2001
    Posts
    1,385
    If you want to simply convert a number from binary to decimal that is simple
    Consider a binary bit in the form 0000 0000
    The number will be 1 or zero representing true or false respectivly.

    and the sequence is:

    128 64 32 16 8 4 2 1

    so 0000 0011 would be decimal 3
    1000 0001 would be 129 decimal
    Monday - what a way to spend a seventh of your life

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Dec to Binary code
    By 4dice in forum C Programming
    Replies: 7
    Last Post: 01-12-2009, 02:40 PM
  2. Replies: 4
    Last Post: 01-18-2008, 06:05 PM
  3. Obfuscated Code Contest
    By Stack Overflow in forum Contests Board
    Replies: 51
    Last Post: 01-21-2005, 03:17 PM
  4. << !! Posting Code? Read this First !! >>
    By kermi3 in forum Windows Programming
    Replies: 0
    Last Post: 10-14-2002, 01:29 PM
  5. << !! Posting Code? Read this First !! >>
    By biosx in forum C++ Programming
    Replies: 1
    Last Post: 03-20-2002, 11:51 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21