r/AskComputerScience • • Feb 22 '20

Can one code in binary?

Can you code using ONLY 0 and 1's. I'm not talking about dificulty or efficiency, but rather the possibility, like making a "Hello World" program in binary.

39 Upvotes

58 comments sorted by

View all comments

1

u/MirrorLake Feb 23 '20

I understand your meaning, and yes, it is possible.

But consider this: a C++ program can be compiled into assembly, and assembly is just human-readable binary code. You can trace your code from C++ -> assembly -> binary with godblot.org.

In the x86 opcode list, po (primary opcode) column lists the binary representation of that thing, but they're converted to hex to save space on the screen. 00-05 are ADD, 08-0D are OR, etc. Every single mathematical operation is actually just binary.

Another way of putting this is, you actually never program in anything that isn't binary.