teach-ict.com logo

THE education site for computer science and ICT

3. Assembly / low level language

The previous page described machine code and how difficult this is to handle by people.

So CPU engineers provide their customers with an 'assembly language' which they can use to program the CPU.

An assembly language is made up of a reasonably small set of command words called 'Mnemonics'

 

Machine Code
Raw Machine code Mnemonic Code

B80200

BB0400

01D8

CD20

MOV AX,0002

MOV BX,0004

ADD AX, BX

INT 20

Instead of the programmer having to remember that 'B8' will load register AX, they can write the command MOV AX,0002 (which happens to load '2' into the AX register).

Now this is much more friendly than raw machine code. For instance the MOV command moves data from one location to another. The ADD command carries out an add operation.

Along with the assembly language comes a software application called an 'Assembler'. This converts the assembly instructions back into machine code.

Assembly is an example of a 'low level language'.

Low level languages have the advantage of providing very close control of the CPU but the code is still quite difficult to read and follow by other programmers.

Each CPU family has its own assembly language and so code written for one CPU family does not run on other CPUs. This means the code is not very 'portable'.

Assembly language is used for applications such as low-level device drivers. It is also used extensively in CPUs that specialise in control as you may find in a washing machine or DVD player.

 

Challenge see if you can find out one extra fact on this topic that we haven't already told you

Click on this link: Assembly language programming