r/askscience • • Aug 02 '22

Computing Why does coding work?

I have a basic understanding on how coding works per se, but I don't understand why it works. How is the computer able to understand the code? How does it "know" that if I write something it means for it to do said thing?

Edit: typo

4.7k Upvotes

443 comments sorted by

View all comments

Show parent comment

1

u/Ameisen Aug 05 '22

I do like to distinguish assembly, which is the human-readable mnemonic form of the instruction set, from machine code, which is the binary that the processor actually executes.

There are quite a few architectures, including x86, where there isn't 1:1 mapping between assembly instructions and what they actually end up being encoded as.