PDA

View Full Version : What is binary code?



DramaKing
12-02-2001, 03:14 PM
What is binary code?

oskilian
12-02-2001, 03:19 PM
are you kidding?

Oskilian

gnu-ehacks
12-02-2001, 03:19 PM
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. :D

-KEN-
12-02-2001, 03:25 PM
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.

Sayeh
12-03-2001, 08:13 AM
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.

iain
12-03-2001, 03:58 PM
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.

Betazep
12-03-2001, 04:48 PM
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)

Isometric
12-03-2001, 04:56 PM
Is it possible to "read" binary code?
like does it follow a pattern or some way to translate it to english?

Nick
12-03-2001, 06:11 PM
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.

gnu-ehacks
12-03-2001, 08:14 PM
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.

Vulcan
12-04-2001, 03:53 AM
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

iain
12-04-2001, 11:46 AM
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