Hacker News new | ask | show | jobs
by Koshkin 826 days ago
> execute assembly

I always thought that assembly was a type of programming language.

4 comments

It is. From my understanding, CPUs execute machine code. Assembly has to be passed through an assembler to get machine code, and that assembler can make other changes as well, so they are not always one to one. Written assembly will usually translate veryclosely to machine code, though.
Ben Eater's excellent educational video series includes one explaining the difference:

https://www.youtube.com/watch?v=oO8_2JJV0B4

In short, assembly for a given CPU is very nearly one-to-one with the machine language for that CPU. It's not correct to conflate the two, but close enough when speaking informally.

While it's true that assembler doesn't quite fit into the same class as compiled/interpreted languages, it would be disingenuous to say it's not a programming language. It's simply a very low-level, machine specific one.

It's even blurrier when you consider that most modern assembler dialects have plenty of high level functionality (structs, macros, labels, etc) that do not correlate to machine instructions.

The GP has a slightly weird language, but mixing assembly and machine code in informal speech isn't rare at all.
Here I'm referring to assembly as mnemonic for machine code, but yes it would have been more correct to say machine code instead.