forum_image

Discussion Forum

Interative Forum for discussing any query literally to UGC-NET Computer Science, GATE Computer Science and Computer Sciene and Technology in general.

ugc_net image

UGC-NET Computer Science

Correspondence Courses and Test Series to prepare for UGC-NET computer science and applications

GATE image

GATE

MCQs, Lecture Notes, Ebooks for GATE preparation

freestuff image
jobs image

Jobs Newsfeed

Timely information of various Recruitments.

NextPrev

Computer organization Notes

Assembly Language

Assembly language was developed to overcome some of the many inconveniences of machine language. This is another low-level but very important language in which operation codes and operands are given in the form of alphanumeric symbols instead of 0’s and l’s. Assembly language is a low level language that uses mnemonics to represent each operation and symbols to represent addresses. These mnemonics and symbols allow for greater readability and ease of understanding that binary does not. It was developed in 1950s. Before the invention of Assembly language the computer code were written in 0s and 1s which is difficult for human to understand. Assembly is second generation language. An assembly language has instructions that are in one-to-one correspondence with machine instructions. In assembly language a Mnemonic is translated into exactly one machine language instruction.
It is called assembly language because the machine instructions are assembled from the source code using a program called an assembler. Assembly language does not need to be compiled or interpreted but it needs to be assembled. As mnemonics are not in binary form and processor understands only binary form, Assembler is required for translating assembly language instruction to some binary form. Assembly language is not a single language, but rather a group of languages. Each processor family has its own assembly language.
Assembly language is the oldest programming language. It bears the closest resemblance to machine language. It provides direct access to computer hardware. To understand assembly you should understand about your computer’s architecture and operating system.
Advantages of Assembly Language
1. It is suitable for time-critical jobs because execution is fast.
2. Assembly language is easy to learn as compared to machine language.
3. An understanding of assembly language provides knowledge of Interface of programs with OS, processor and BIOS.
4. Assembly language tells us about representation of data in memory and other storage devices.
5. It is easy to locate and correct errors.
6. It is easily modified.
7. The programmer learns how processor accesses and executes instruction and how instructions accesses and process data.
8. An expert Assembly language programmer can often produce code that is much smaller and much faster than a high level language programmer can. For some applications speed and size are critical. Eg:- code on a smart card, code in a cellular telephone, device drivers, BIOS routines etc. Assembly language helps in developing such systems.
9. Access to the Machine : Procedures can have complete access to the Hardware (Not possible in High level language) eg: low level interrupt and trap handlers in OS.
10. It is most suitable for writing interrupt service routines and other memory resident programs.

Disadvantages of Assembly Language
1. Like machine language, it is also machine dependent/specific.
2. Since it is machine dependent, the programmer also needs to understand the hardware.
3. As assembly language programs are written for a specific family of processors, so these programs will not run on another family of processors. So assembly language programs are non-portable.
4. As assembly language is a low level language, you have to know the details of hardware and addressing modes.
5. As assembly language has 1:1 correspondence with machine language, the source code is long and unreadable.
Features of Assembly language:
As discussed earlier, assembly language is processor specific, still it has some common features as discussed below:
1. Of all languages, Assembly language bears the closest resemblance to machine language. It provides direct access to computer hardware. It helps us to understand much about computer’s architecture and operating system.
2. Assembly language uses mnemonics to specify processor instructions.
3. It uses symbols in place of constants or memory addresses.
4. Mostly assembly language has instructions that are in one-to-one correspondence with machine instructions. In assembly language one instruction is translated into exactly one machine language instruction.
5. Mostly assembly language has one instruction corresponding to one machine language instruction but it has some supporting instructions also which are required for assembler itself.
6. Assembly programs are generally faster than programs created in higher level languages. Often, programmers write speed-essential functions in assembly.
7. It's powerful – You are given unlimited power over your assembly programs.
8. Assembly programs are often much smaller than programs written in other languages. This can be very useful if space is an issue.
9. It is a low level language. It is machine (processor) specific.
10. In Assembly language, memory and registers are accessed directly. Often, binary numbers are used to describe the contents of computer memory; at other times, decimal and hexadecimal numbers are used. So programmers must develop certain fluency with number formats, so they can quickly translate numbers from one format to other.
11. Because assembly is a machine specific language, it is not portable. Program written for a specific family of processors can’t execute on some different family of processors.
12. Assembly program is not in binary form. So it requires some translator to convert assembly program to binary form. To translate assembly language instructions, assembler is used.
13. Assembly has some instructions which are used to issue commands to assembler. These instructions are known as Pseudo Instructions or assembler directives. For example, ORG directive is used to inform the assembler about the starting address of a section of a program.
14. The programmer does not have to be concerned about actual value of Branching target address. He/she can give a name to this address.
15. Constant may be specified in any base (Binary, octal, decimal or hexadecimal).
16. Assembly Language is more low-level than other high-level languages, so it offers more possibility for error and requires programmers to have a great deal of knowledge of what they are doing
17. Assembly is useful in time-sensitive or resource-heavy operations. Assembly has direct control over the processor, and this allows to make efficient programs that would be impossible in high level languages.
Why Learn Assembly Language:
Embedded programs: sometimes you may have to write embedded programs. They are short programs stored in a small amount of memory in single-purpose devices such as telephones, washing machines, air-conditioning and printers etc. Assembly language is an ideal language for writing embedded programs because of its economical use of memory.
Real-time applications: Real time systems require precise timing and responses. High-level languages do not give programmers exact control over machine code generated by compilers. Assembly language permits you to precisely specify a program’s executable code.
Computer game: Computer games require small code size and fast execution. Game programmers take full advantage of hardware features of the system. They use assembly language as because it permits direct access to computer hardware, and code can be hand optimized for speed.
Good teaching tool: Assembly language helps you to gain an overall understanding of the interaction between computer hardware, operating systems, and application programs. While learning assembly language, internal details can be learnt.
Some high-level languages don’t allow low-level tasks such as bit manipulation. In such an environment, programmers will often call subroutines written in assembly language to accomplish their goal.
Device drivers: Device drivers are created for the devices. Device drivers are programs that act as interface between device and operating system. For example, Printer manufacturers, create a different MS-Windows device driver for each model they sell and different device drivers for other operating systems. These device drivers access hardware directly. Assembly language is used to develop device drivers.





You can obtain Printed Copies of this material by making a request at brightways.org@gmail.com with a nominal print charges.

   

Return To Computer organization Topics