thejsway / thejsway

The JavaScript Way book

Home Page:https://thejsway.net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Machine language != Assembly language

msegado opened this issue · comments

First: thanks for making this book available!

I just came across the following in intro02.md:

The only programming language directly understandable by a computer is machine language, also known as assembly language.

I believe this is incorrect... Machine language and assembly are actually two distinct things. Machine language usually refers to the actual binary format understood by the processor, that is, the set of ones and zeros that you feed into it to make it do stuff. Assembly, on the other hand, is a (barely) human-readable language that translates nearly one-to-one into machine code... but not quite. One substantial difference of assembly is the ability to use abstract labels for jump locations and have the jump address offsets computed automatically (instead of having to compute them manually, and then having to change them all any time you add/remove any code between them): https://stackoverflow.com/a/3551967 . Also, in some cases assembly language include pseudo-ops, which don't always translate to the same machine instruction or which translate to multiple machine instructions: https://stackoverflow.com/a/40784745 .

Hope that helps!

Enlightening, thanks!