Since some of you were curious...
CPUs and microcontrollers have an instruction set - which is basically an internal set of commands (instructions) that it understands and can execute. This could be like adding instructions, subtracting, storing or reading from memory, branching, and more complicated instructions.
Assembly is like a human representation of machine instructions. For example, "ADD $1, $2" might directly translate to 1100000000010010 (now I'm just making this completely up, this is a fake 16-bit instruction.)
There is typically a one-to-one correlation between a regular assembly instruction, and a machine instruction. There are "macro" instructions that basically execute multiple assembly instructions - but that's kind of a software based feature in assemblers (software used to produce assembly). Before assemblers, people had to use punchcards (where 1's and 0's are represented by a hole or no hole) and what not to feed their programs into a computer. In a way, a punch card and assembly are very similar - different ways of representing the same thing.
If you look at a high-level language instruction, like say: i = 20+5;
It might look like one line of code... one C language instruction - but really it takes multiple machine instructions to execute this one line - because the processor does not natively understand what that statement means. Compilers are what translate high languages to machine language.
High-level languages do not require you to really understand how the processor works - the CPU kinda becomes an abstraction. Heck, with Java - it uses a "Virtual Machine," which is like a processor that does not physically exist. I suppose you could make an actual Java machine (Never heard of one) kinda like how there are lisp and prolog machines.
I'll continue on later, if I haven't bored ya'll already.
CPUs and microcontrollers have an instruction set - which is basically an internal set of commands (instructions) that it understands and can execute. This could be like adding instructions, subtracting, storing or reading from memory, branching, and more complicated instructions.
Assembly is like a human representation of machine instructions. For example, "ADD $1, $2" might directly translate to 1100000000010010 (now I'm just making this completely up, this is a fake 16-bit instruction.)
There is typically a one-to-one correlation between a regular assembly instruction, and a machine instruction. There are "macro" instructions that basically execute multiple assembly instructions - but that's kind of a software based feature in assemblers (software used to produce assembly). Before assemblers, people had to use punchcards (where 1's and 0's are represented by a hole or no hole) and what not to feed their programs into a computer. In a way, a punch card and assembly are very similar - different ways of representing the same thing.
If you look at a high-level language instruction, like say: i = 20+5;
It might look like one line of code... one C language instruction - but really it takes multiple machine instructions to execute this one line - because the processor does not natively understand what that statement means. Compilers are what translate high languages to machine language.
High-level languages do not require you to really understand how the processor works - the CPU kinda becomes an abstraction. Heck, with Java - it uses a "Virtual Machine," which is like a processor that does not physically exist. I suppose you could make an actual Java machine (Never heard of one) kinda like how there are lisp and prolog machines.
I'll continue on later, if I haven't bored ya'll already.



Comment