Is there a programming language "below" Assembly?
Thanks.
views:
1481answers:
16Machine 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.
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. ;)
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.
Actually there's a level of code that sits above machine code, called Microcode.
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."
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.
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.
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++)
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"
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.
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.
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.
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).
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.