Jump to content

How does machine language work

Featured Replies

I understand that machine language ( and assembly ) is the only language that the computer understands. But, how is a microprocessor able to read these codes ?

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

Basic programs are loaded in the Rom to do that work. When we turn on the computer, the loaded program do their job according to the assembly language.

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.

Archived

This topic is now archived and is closed to further replies.

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.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.