Assembly language program

ComputersComputer ProgrammingElectronics & ElectricalMicroprocessor

After machine level language, the next level of development in the evolution of computer languages was the Assembly Language. Machine level language uses only the binary language. But on the other hand, assembly language uses mnemonics or symbolic instructions in place of a sequence of 0s and 1s. As example, we can consider that, to add register A and B in a particular computer, assembly language uses the mnemonic ‘ADD B’ in place of 10001111. In assembly language, we use symbolic names to denote addresses and data. A number of such examples are dealt with in the successive chapters. Thus writing a program in assembly language has advantages over writing the same in a machine language.

Now let us discuss what are the disadvantages of writing programs in assembly language. These disadvantages are

  • Assembly language programs are platform dependent. Mnemonics in one architecture, may not work in another architecture. This is because each architecture has got a dedicated set of mnemonics. As example, ADD B in one architecture means the content of accumulator will get added with register B. But in another architecture its meaning may differ. In other words, a program written in assembly language is also not portable.

  • Assembly language program writer, must be highly conversant with the organization and architecture of the computer system being used.

  • An assembler, which is a translator program, is needed for translating the assembly language program into machine code. But each assembly language instruction is translated into only one instruction in the machine language. Assembler programs are not costly; they are quite cheap.

Advantages of assembly language program: The advantages of writing in assembly language are -

  • Compared to machine language programs, programs in assembly language is less tiresome to work with and much less error prone. While writing the program, if a typographical error occurred due to oversight, then also it is much easier to debug the code and find the error and rectify it. Assembler program can detects errors and can produce required error messages accordingly.

  • By a glance through the program codes and mnemonics, it is much easier to visualize the function of the program.

  • Compared to high level language written program execution speed, program written in assembly language will be faster and almost same as the speed of execution of the same program written in machine level language.

Nowadays, where very high-speed execution is required, there we can use assembly language programs. However, in microcomputer systems, it is widely used. As low-level language we mean both machine language and assembly language. As an example, we can consider the following assembly language program written for 8085 microprocessors

Address
Hex Codes
Mnemonic
Comment
2000
3E
MVI A, 88H
A ← 88H
2001
88

88H as operand
2002
06
MVI B, 44H
B ← 44H





raja
Published on 02-Jan-2019 11:38:00

Advertisements