Assembly code

Assembly code is another form of low-level language. Assembly code is created by the developers of processors. Assembly languages are architecture dependent - the form of assembly code depends upon the manufacturer of the processor.

Like hexadecimal code, assembly code does need some form of alteration before it can be understood by the processor. An assembler is the name given to the software that converts assembly code into binary instructions.

Assemblers generally allow for one to one conversion between an assembly language instruction and binary code. Assembly language is often used when high performance is crucial. The main drawbacks of assembly languages are lack of portability and the time that it takes to learn how to program.

Here is the same instruction three times, once in binary, once using hexadecimal notation and once using an assembly language.

Binary instructionHexadecimal machine codeAssembly code
101101000000000010110000000100111100110100010000B4 00 B0 13 CD 10mov ah, 0 / mov al, 13h / int 10

Key points

  • Low-level languages generally allow for a one to one conversion into machine code (binary)
  • Hexadecimal notation is a low-level language
  • Assembly code is a low-level language
  • Assembly code is architecture dependent (different codes exist for different types of processor)
  • Assembly code is not fully portable because of architecture dependence
  • Assembly code needs to be converted to binary using an assembler
  • Low-level languages are hard to learn

Low-level languages are used for the following reasons:

  • Optimisation of code
  • Where no translator software exists
  • Greater control of hardware features, eg in small embedded computers such as home appliances.

Optimisation of code means creating code that places as little demand on system resources as possible. Low-level languages will place a much lighter load on processor and memory than use of a high-level language.