Jump to content

How does machine language work


CarbonCopy

Recommended Posts

It has been a while, but...

 

Assembly is not machine language and therefore not understood by the machine. It must first be compiled or assembled into machine code to be used. Assembly is just much closer to machine code than, say, Java.

 

Machine code is developed in conjunction with the microprocessor. Microprocessors can only read the machine code developed for that family of microprocessors, not for some other microprocessor family.

 

A player piano analogy...

 

The composer is the software developer

The sheet music the source code

The punch machine to create the piano roll is the compiler

The piano roll is the machine code

The player piano is the microprocessor

 

The player piano can play the piano roll because that is what it was designed to do. It expects the holes in the paper to be formatted in a predetermined way. The piano reads the hole, which is simply an instruction to play a predetermined note.

 

The microprocessor can read the machine code because that is what it was designed to do. It expects the instructions to be formatted in a predetermined way. The microprocessor reads the code which is simply an instruction to perform a predetermined action.

Edited by zapatos
Link to comment
Share on other sites

Assembly language allows human being to write machine language. For example there could be an assembly language instruction "add", which then gets translated, to the appropriate bit pattern which is the machine language instruction, by the assembler.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.