A program written in assembly is machine dependent but a program written in Java ,python etc.. are not. why is that

at the end don't they all get converted in to machine language?

Recommended Answers

All 4 Replies

" why is that at the end don't they all get converted in to machine language?"

Because machine language is what the computer understands. All the rest is just there to make things more readable, and less error prone, for us mere humans.

no no...........

why is that? at the end don't they all get converted in to machine language

(so why is only 'assembly' langage machine dependant and not other Hlevel langs ,if they all get converted into machine laguage at the end.) .

that is the exact question I acutally meant to ask.

(so why is only 'assembly' langage machine dependant and not other Hlevel langs

Because there is a direct one to one correspondence between assembly language instructions and machine code instructions. On the other hand there is no direct correspondence between machine code and something like "strcpy(str1, str2);" so the latter can be translated in different ways for different processors.

If you have source code written in a high level language like C++, then:

You would use compiler A to translate it into machine code that processor A understands........
You would use compiler B to translate it into machine code that processor B understands........
You would use compiler C to translate it into machine code that processor C understands........
Etc.

So a high level program can be translated into any of the different machine languages simply by using the right compiler that targets the particular processor of interest.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.