Thursday, August 2, 2018

What is Assembly Language ?



The assembly language, introduced in 1950's, reduced programming complexity and provided some standardization to build an application. The assembly language, also referred as the second generation programming language, is also a low-level language. In an assembly language, the 0's and 1's of machine language are replaced with abbreviations or mnemonic code.

     The main advantage of an assembly language over a machine languages are :

  • As we can locate and identify syntax errors in assembly language, it is easy to debug it.
  • It is easier develop a computer application using assembly language in comparison to machine language.
  • Assembly language operates very efficiently.
an assembly language program consists of a series of instructions and mnemonics that correspond to a stream of executable instructions. An assembly language instruction consists of a mnemonic code followed by zero or more operands. The mnemonic code is called the "  Operation Code  " or "            " Opcode ", which specifies the operations to be performed on the given arguments. Consider the following machine code :
10110000 01100001
Its equivalent assembly language representation is :
mov al, 061h

     In the above instruction, the opcode " move " is used to move the hexadecimal value 61 into the processor register named ' al ' . The following program shows the assembly language instructions to subtract two numbers :
ORG 500                            /Origin of program is location 500
LDA SUB                          /Load subtrahend to AC
CMA                                  /Complement AC
INC                                    /Increment AC
ADD MIN                         /Add minuend to AC
STA DIF                            /Store difference
HLT                                   /Halt computer
MIN, DEC 56                   /Minuend
SUB,   DEC -2                 /subtrahend
DIF,  HEX 0                     /Difference stored here
END                                 /End of symbolic program



  It should be noted that during execution, the assembly language program is converted into the machine code with the help of an " Assembler " . The simple assembly language statements had one-to-one correspondence with the machine language statements. This one-to-one correspondence still generated complex programs. Then, macro instructions were devised so that multiple machine language statements could be represented using a single assembly language instruction. Even today programmers prefer to use an assembly language for performing certain tasks such as :
  • To initialize and test the system hardware prior to booting the operating system. This assembly language code stored in ROM
  • To write patches for disassembling viruses, in anti-virus product development companies 
  • To attain extreme optimization, for example, in an inner loop in a processor-intensive algorithm
  • For direct interaction with the hardware
  • In extremely high security situations where complete control over the environment is required 
  • To maximize the use of limited resources, in a system with several resource constraints 





Please follow, comment and share

No comments:

Post a Comment

Applying Software Development Method

To understand how software development method is applied, Consider a simple scenario where it is required to convert the temperature given ...