Is there a programming language "below" Assembly?
-
2http://en.wikipedia.org/wiki/Computer_programming_in_the_punch_card_era – George Mar 25 '09 at 13:31
-
http://youtu.be/j9I2KfGKv4M is a good lecture on the difference between Instruction Set Architecture and Micro Architecture – ams Feb 17 '14 at 16:52
-
The language below machine code is logic for writing hardware, maybe Verilog or VHDL (modulo microcode which might be in between.) – Erik Eidt Mar 02 '21 at 14:23
17 Answers
Actually there's a level of code that sits below machine code, called Microcode.

- 7,118
- 3
- 35
- 40

- 4,530
- 21
- 22
-
I consider microcode to be machine code. Just a different variant that lives on the processor, rather than being run from RAM. – Brian Knoblauch Nov 05 '08 at 19:35
-
20microcode is a block of ROM where each bit is used to toggle some internal circuitry. a sequence of 'words' guide the CPU to perform a single machine language instruction, therefore, it's 'below' even machine language. – Javier Nov 05 '08 at 21:25
-
4I agree with Javier. We built a microcoded processor as part of a university course once. Very fun! – Hannes Ovrén Nov 05 '08 at 21:30
-
On the same page as Javier. It's not the same as machine code.. It's realy what machine code uses. – baash05 Nov 06 '08 at 05:11
-
3Sijin and Javier are correct. This should be the accepted answer. – Windows programmer Dec 25 '08 at 08:47
-
1Yes, microcode is the right answer here. Assembly instructions (or their machine code equivalent) in turn execute microcode programs. On a CISC architecture like x86 the microcode can be quite complex. For example, the x86 FDIV bug is a bug in the microcode for the Pentium's floating point divide machine code instruction. – Nelson Jul 28 '09 at 15:20
-
4
-
7Not all processors have microcode though. In any case, it should be: `C -> assembly -> machine code -> microcode -> circuits -> atoms -> ?????` – L̲̳o̲̳̳n̲̳̳g̲̳̳p̲̳o̲̳̳k̲̳̳e̲̳̳ Jun 24 '10 at 16:16
-
Microcode is more than just setting circuits today. For some complex instructions there is actually a real program (mostly system calls or things like fsin on x86) – Axel Gneiting Jan 18 '12 at 20:27
Machine code. Time it was programmers coded in the 1 and 0's of binary. Hex was considered an advance over this. That was before assembly, which uses the code's names and separates the parts of an instruction into its parts.

- 60,628
- 22
- 121
- 123
-
5Machine code is a direct translation of Assembly, so I wouldn't say it is below it. – Marius Oct 18 '09 at 12:44
-
7@marius, My pc can run machine code, but not assembly. So it ain't equal ;). – Dykam Oct 19 '09 at 14:23
-
5I don't know what state-of-the-art assembler programs can do these days, but in the Olden Days, a macro assembler could do a fair bit of automatic stuff for you (function entries, keeping track of argument counts, automatic allocation, conditional macro expansion and other Neat Stuff that is a chore to do manually). So I'd say that machine code is "lower" than assembly for taht reason. – Vatine Oct 19 '09 at 14:29
-
2@Vatine, the commonly available assembler GNU as is a huge step backwards from the good ol' days. Anyone who's hand-assembled a bootstrap loader will appreciate that assembly is a substantially higher level of abstraction above machine code, even if there is largely a 1:1 mapping between instruction mnemonics and instructions. – RBerteig Sep 01 '10 at 07:27
-
2@Marius C code generates machine code, just as Assembly assembles into machine code, so you're saying that C and Assembly are on the same level? – Brian Knoblauch Dec 01 '10 at 15:41
-
@Marius, assembler is derived from and layered on top of machine language. I would say that machine language is below assembler. – Walter Mitty Aug 11 '12 at 12:38
Assembly is a text representation of Machine code. It has a single statement which represents a single instruction within the CPU itself. "MOV X, Y" for example, is a single instruction which passes through the CPU and moves a value X into position Y. To get to machine code, the CPU will have a number that represents 'MOV', and a number that represents 'X' (if it's not already a number), and a number that represents Y. These raw HEX binary values are the Machine code. It's the numbers that cause the CPU to direct voltages / currents through the transistors to make it do what it does.
Machine code is a lower level, but it's very very close to assembly. It's so close, that no one bothers using it due to the advantages of being able to read the instruction "MOV" = move. Variable names also become readable rather than raw addresses in the stack or heap.

- 10,944
- 6
- 56
- 81
-
5Well, many assemblers actually allow for labels in subsitution for an address. So assembly is not quite just a text representation of machine code. – Calyth Jan 07 '09 at 01:44
And to go even lower, (not that the word "language" is appropriate for "machine" language or for even lower physical layers), but below machine language is the configuration of the many gates and switches used to actually implement each binary opcode for the particular hardware (CPU) involved... A great book to read that covers this even lower level is by Charles Petzold, called "CODE"

- 143,358
- 22
- 150
- 216
I think the lowest you can get is something called Physics or TRW (The Real World). This is what chip designers and manufacturers use to create CPUs and other processors that can take the output of computer languages and turn them into something valuable.

- 22,355
- 2
- 39
- 64
Depends on why you're asking. There's nothing that you can't do in assembly that you can do via some other method. Machine code is just another representation of the exact same data.

- 299,747
- 42
- 398
- 622
-
2Not 100% accurate.. You can't optimize your assembly via another method. I mean even a x*=2; in c++ might not be compiled down to the most efficient assembly. A for loop might not use the cx registry(8086). There are things you can only do in assebly... Tis why it's still used as a language(by sum) – baash05 Nov 06 '08 at 05:17
-
2Actually there are some things that can not even be done with assembly. Some kinds of self-modifying code, or using instructions as data and vice-versa. (on x86 with variable-length instructions... the possibilities...) – Artelius Nov 07 '08 at 21:27
The very first computers (ENIAC) used hard wiring so that output from one computation could be fed as input to another. To run another program, you had to unplug some cables and re-wire them differently.

- 893
- 7
- 11
Assembler is translated into machine code by the assembler. You could write it with a binary editor. (Ouch!) CISC computers can have microcode, which sequences segments of the chip (ALU, memory fetch, etc). Typically, no one writes microcode, except at the chip manufacturer.

- 2,200
- 1
- 14
- 18
Well, there's machine language, as others have mentioned. Machine language is typically a 1-to-1 translation of what you write in assembly, so it's at the same level of abstraction as assembly code -- just much harder to write by hand.
There are exceptions to this, like the pseudo-instructions provided by the MIPS assembly language.
There is, or maybe I should say was a level below even assembly/machine language: microcode. Modern logic-transistor budgets being what they are, I suspect that microcode is losing its relevance.

- 9,424
- 1
- 39
- 37
-
3Microcode is definitely still around; it's too difficult and "bug"-prone to hardwire everything. – Artelius Nov 07 '08 at 21:28
You could send electric currents into the CPU and tell it where to place pixels. (Pretty much binary, but you don't use the computer to write it.)

- 13,850
- 9
- 56
- 64
Well, you can always write code in binary (or hex, or some other representation). You'll then have to calculate jump offsets etc in your head. Not recommended. ;)

- 6,651
- 1
- 27
- 28
-
I've done that with 6502. But I don't think that entering the hex code could be considered a language... I talk hex! :-) – Alexis Wilke Jan 18 '18 at 17:45
Sort of. Machines don't read assembly, they read "machine language", which is what assembly is converted into. Machine language has "opcodes" instead of assembly's mnemonics, and these opcodes are usually just binary data. Machine code isn't usually considered human-readable.
On RISC systems, machine code is often a straightforward translation of assembly, but on x86 systems, in particular, the two are quite different.

- 2,005
- 13
- 12
-
1Actually, on x86 it's also a straightforward translation. Do you have any examples that show otherwise? – Nathan Fellman Nov 05 '08 at 20:51
Sure: "machine code", about which, Wikipedia, in the article on Assembly Language (http://en.wikipedia.org/wiki/Assembly_language), says: "implements a symbolic representation of the numeric machine codes and other constants needed to program a particular CPU architecture."

- 12,287
- 13
- 80
- 147
Even below machine code, one could say, is VHDL - chip design. You don't even need to design the chip to execute code, but just instantly transform inputs into outputs.
(not that I'm an expert - I'm using C++)

- 40,723
- 12
- 105
- 192
-
1But after building the chip, you can't really program it. So I don't think it's really relevant. – Hannes Ovrén Nov 05 '08 at 21:33
-
2When using this on an FPGA, it _is_ reprogrammable. Still, I'm not an expert :) – xtofl Nov 06 '08 at 13:36
Assembly language is the lower floor of the programming language building as machine code is not a language because it does not involve any grammatic rules to follow. Machine code may be the only data format to execute microprocessor operations: the CPU fetches data from memory and executes the instruction directly according to the machine code fetched.
However, in some recent designs, such as the Intel Pentium 4 and up, machine code is the expression of a lower level RISC execution unit operations, known as uops or microoperations. So the decoding logic of those designs is to translate CISC-type instructions into small uops which are generally targeted at a simpler load/store unit, RISC-like. In this aspect, we can say (altough this may not be technically exact) that machine code describes the "higher-level" complex instructions of the architecture, not the "real" operations that are carried atomically by the underlying execution logic of the CPU.
So we've an architectural instruction set, or architectural machine code, and an inner-level "micro-instruction" set which is hidden from the outer world. The trace cache of the Intel processors was conceived to store such ops to optimize the superscalar performance of the processor (as the CPU executes uops not the architectural instruction-set available for execution by programs).

- 4,527
- 2
- 32
- 47