Can you tell an assembly language when you see one?
wordsandbuttons.online
wordsandbuttons.online
Green Arrays Inc was producing forthchips in 2011.
I don't follow Forth.
Also, while C might not be an assembly language... it combines the power and performance of assembly language with the flexibility and ease-of-use of assembly language.
That is not to say that you can't have macros in an assembly language. While you can't unambiguously recover any macros (or label names, for that matter) used when generating assembly language from the binary output, you can still unambiguously recover some sort of assembly which can be used to generate an identical binary output, excepting any junk your particular platform does that prevents reproducible builds such as embedding timestamps.
This isn’t true for many CPU assembly languages, though. For example, the x86 instruction `add eax, ecx` can be assembled to either `01 c8` or `03 c1`.
> you can still unambiguously recover some sort of assembly which can be used to generate an identical binary output
If your binary contains `01 c8`, information is lost when that’s disassembled to `add eax, ecx` and there’s no guarantee that a newly assembled binary won’t contain `03 c1` in its place.
It was how Xerox PARC workstations worked, the bytecode of Interlisp-D, Mesa, Mesa/Cedar, Smalltalk worked, with microcode interpreter loaded on boot for them.
How Lillith (Modula-2) and Cedar (Oberon) workstations worked, with hardware implementation of their bytecode formats.
How some Java CPUs like Jazelle and JavaOS worked.
How Pascal USCD worked on Constellation OS by Corvus Systems.
How Burroughs B5500 mainframes worked, with ESPOL/NEWP intrinsics, still being shipped by Unisys nowadays on a completely unrelated hardware form.
I certainly can dig out a couple of other examples.
I define Assembly as the lowest level that is user-accessible. I think you would say that's a rather arbitrary division in the case of x86, when there is a sophisticated microcode language underneath it?
In some platforms they are even the only kind of format for executables and raw Assembly is forbidden to any userspace application, e.g. IBM i (nee AS/400) TIMI environment, where raw machine code is only available to the kernel, in the POSIX subsystem or special binaries produced via the Metal C compiler.
Person using definition B: No it isn't!
---
Actual situation: Different people using the same word to refer to different things.
Edit: I suggest that as a necessary condition for something to be assembly,
disassemble(assemble(x)) = x,
modulo comments and label names.
disassemble(assemble("nop")) == "add r0, 0"
I think that's how v850 or tricore do it. Than there is ARM, for which the v8.6 ISA manual casually contains the term "This instruction is an alias of" 115 times. (I checked the rev. F PDF, you can get the rev. G PDF at https://developer.arm.com/documentation/ddi0487/ga/ by clicking "Download").I think a huge problem is how it is easy to mix up assembly that gets "processed" to /machine/ instructions with another kind of assembly that gets "processed" to VM ops. Which then get compiled again (usually JIT) before being executed.
ILAsm is a nice example for that: It's some kind of assembly language, and you could probably go right down to x86 instructions (at least with little change). But you'll never do that. Simply because it is a stack language; and while you can produce e.g. x86 opcodes that "do the right thing", the whole stack traffic will kill performance. Instead, the VM will push the opcode stream through a (I guess JIT?) compiler: Small functions will be inlined, others will get a prologe and epiloge, parameters and return values are arranged according to the ABI's calling conventions. And then there will be all the usual register allocation stuff. [edit] And a lot of other magic. [/edit] Still, the original input is pretty much an assembly language.
That's not-quite-correct, since the Smalltalk-80 implementation manual sitting on my shelf explicitly details the bytecode that compiles to. It's not "as far from low-level programming" as can be, it compiles directly to a bytecode!
But, inadvertently, such influential projects gradually warp the definition of the word 'assembly' or 'assembler' away from what it traditionally was: the most close to the metal and minimal abstraction from hardware.
Perhaps that's OK? But it does cause some arguments
But it seems like it could be a better definition, as it gets closer to the essential meaning.
After all these gates it turns out that while RISC had some nice ideas, the flexibility of microcoded CPUs won the war anyway, and nowadays stuff like FPGAs makes it even more flexible than traditional microcode languages.
That said, probably most of the time when people say "assembly language" their definition is not as strict as mine.
Most mainframes, like those from Xerox PARC, don't have any kind of Assembly, the first step of booting was to load the corresponding microcode execution engine.
(And most instructions correspond to 1 or a few uops in a straightforward way).
That is, you still need a compiler, with optimization, register/stack allocation, etc... before you start outputting machine code that is run by the hardware. However all the tricky parts of ADA, the task model in particular, are implemented in hardware.
So it doesn't make ADA an assembly language.
Maybe FORTH and LISP could be considered assembly in some circumstances. I don't know enough about these and their machine implementation to be sure but it looks like there can be a 1:1 relationship between these languages and machine code.
``` uint64 r0 > >= 1 ```
If there were no space between > and >= it would be ordinary looking C-minus-semicolons.