The bookkeeping involved in machine language programming is very tedious. If a programmer is modifying a program and decides to insert an extra data item, the addresses of other data items may be changed. The programmer will have to carefully examine the whole program deciding which bit patterns represent the addresses which have changed, and modify them.
Human beings are notoriously bad at simple repetitive tasks; computers thrive on them. Assembly languages are a more human friendly form of machine language. Machine language commands are replaced by mnemonic commands on a one-to-one basis. The assembler program takes care of converting from the mnemonic to the corresponding machine language code. The programmer can also use symbolic addresses for data items. The assembler will assign machine addresses and ensure that distinct data items do not overlap in storage, a depressingly common occurrence in machine language programs. For example the short section of program above might be written in assembly language as:
Obviously this leaves less scope for error but since the computer does not directly understand assembly language this has to be translated into machine language by a program called an assembler. The assembler replaces the mnemonic operation codes such as ADD with the corresponding binary codes and allocates memory addresses for all the symbolic variables the programmer uses. It is responsible for associating the symbol
address LOAD A ADD B STORE C
Cwith an addresses, and ensuring that they are all distinct. Thus by making the process of programming easier for the human being another level of processing for the computer has been introduced. Assembly languages are still used in some time-critical programs since they give the programmer very precise control of what exactly happens inside the computer. Assembly languages still require that the programmer should have a good knowledge of the internal structure of the computer. For example, different
ADDinstructions will be needed for different types of data item. Assembly languages are still machine specific and hence the program will have to be re-written if it is to be implemented on another type of computer.