Liam Jackson
Liam Jackson

Reputation: 1

What is the relation between machine code and assembly language?

I want to know the relation between machine code and assembly language.

Are assemblers made together by the architecture manufacturer?

Otherwise, is it possible for anyone to manufacture assemblers by referring to the architecture manufacturer's set of Instruction?

Have a nice day!

Upvotes: 0

Views: 228

Answers (1)

old_timer
old_timer

Reputation: 71536

if you wish to be in the processor business be it a chip or an IP core, you will not get very far without a toolchain. Be it a home grown like the old days (There are still folks that do this) or say gnu or llvm.

Likewise, you will not get very far without instruction set documentation. That documentation pretty much always includes a syntax. Now that syntax ideally matches the syntax for the assembler tool that the vendor has created or supported. But you may see tools evolve without the documentation matching. You need some minimal way to describe the instruction set with something human readable. So this has been the norm.

But having a standard is not the way things happen. Easy to see with popular platforms, ARM, MIPS x86 (not talking about intel vs at&t), etc.

The assembler author(s) are perfectly free to do whatever they want, as we have seen.

orange pickle,apple[#4]

could be a perfectly valid instruction, all you need is one person to create an assembler with that syntax, and then it exists.

Now how useful and how popular would your assembler be? Not very. Overloading of mov in x86 was in desperate need of different mnemonics, but even there you would feel some resistance despite resolving a lot of issues of the original byte ptr type solutions.

Basically if the assembler generates usable machine code for the target, it is an assembly language. Also understand that while two tools may support ldr r0,[r1] the mnemonics for the instructions are not the whole assembly language. Most of the time the incompatibilities are beyond the instructions themselves, how do you make a comment, define a label, macro, represent numbers (decimal, hex, etc). But we see with the mainstream tools the instructions themselves are incompatible (not talking about intel vs at&t differences). So this has already happened, and continues to happen.

Some are made by the vendor they create/own the tool. Some are contracted. And free tools, GNU, LLVM, for example employees will support that effort directly. And likewise there are tools that have been created that are created by people completely separated from the vendor.

Is it possible to create an assembler from the documentation. Actually that is rare as I used to and sometimes still do learn an instruction set by writing a disassembler. Some are better than others, usually you need a working tool in order to figure out the gaps in the documentation. But, yes, if the documents are well written you could certainly create your own assembler, linker, etc.

Upvotes: 3

Related Questions