Is assembler a translator or transcriptor?
I think it is a translator because when it converts assembly language to machine code, then that code can be understood by hardware.
Could somebody explain this concept to me?
views:
26answers:
3I would call it a translator for exactly the reason you gave.
Also, because I have no idea what a transcriptor
is (and neither does Dictionary.com)
Wiki says:
If the translator translates assembly language to machine code such kind of translator is called assembler.
I totally agree with it. Machine code is a programing language.
To answer your question, an Assembler is a translator that converts human readable instructions into a code that is suitable for a machine to understand. All kinds of tools such as assemblers, compilers, interpreters are nothing more than translators.
A translator is a complex software that has to analyze each and every single syntax, for an example
let x = 4
This is just an example, to us humans, it means assigns the value of a variable called 'x' in this case, 4, the translator would convert this to an equivalent machine code like this
mov [bx], 4
As you can see from this simple example, the translator has to work out the location of where the variable 'x' reside in memory and to perform the instructions necessary to make it functionally equivalent to the human readable syntax. The translator has separate parts that make up a valid syntax
- let
- x
- =
- 4
Suppose the wording was like this
lets x = 4
The translator would flag this as a syntax error
- lets
WOOOPS!!!
the translator has no knowledge of that word 'lets' so flag up a syntax error, the end result would be "Syntax error, 'lets' unknown!" which would be displayed to the end user, i.e. the programmer..
That is how a translator works.
As for transcriptor, thats a new one to me never heard of it.