Assembly language

From ArticleWorld


A combination of zeros and ones are read by the machine (machine language), but an intermediary such as an assembly language substitutes these raw values with symbols. The machine language, one must note, is unique to each computer’s architecture.


Instructions or commands are converted into machine language by an assembler. The response or the output would still be in machine language and would be transformed back into a human-readable for by the disassembler.

The following diagram representing the flow of information from assembly language to machine and back.

Instructions in source code => (Assembly language)=> (Machine Language) => Output in Machine Language

Output in Machine Language => (Dis-assembler)=> (Output in human readable format)

If the assembler and the dis-assembler work as one understands, then it is only logical to assume that the number of instructions in assembly language will equal the number of instructions in machine language. While this is true to a great extent, in some cases such a simple 1:1 ratio is not possible in for all instructions. For example, a control statement like “branch is greater than or equal to”. Should be just one instruction in machine language. That is not the case. Some times the instructions may expand to pseudo instructions.


Contents

Machine instructions

Usually very simple, the instructions in assembly language would have some common operations. They are

  • move
  • compute
  • influence the program-flow


Assembly language directives


Assembly languages, besides having codes for machine instructions also provide for the assemblage of data blocks. This makes the life of a programmer much more pleasant because they have to deal with the problem of assemblage of data day-in day-out. In addition, they have directives for the assignment address locations for instructions or code.


One of the built-in capabilities of assembly languages is the ability to ignore the comments included by the programmer in the source code. The tedium of repetitive operations can be avoided by programming or recording macros because assembly languages are geared p for recording macros.


Usage of assembly language


The early languages were assembly languages (entirely) and were very close to binary code. The IBM PC spreadsheet Lotus 123 is one such language. Today, however, languages have become more user-friendly. While some argue that today’s compilers are very advanced, making the assembly language redundant, there are many that favor the continued use of assembly languages.


Some advantages of assembly languages


A few discrete mathematical operations can be coded for in assembly language for faster processing. Low-level programming is easier to carry out using assembly languages Device drivers, device drivers device drivers! Interaction between the operating system and the hardware has to be in a low-level language. Enter assembly language.