Search This Blog

Sunday, 20 October 2013

assembler

All computers at bottom consist of circuits that can perform a repertoire of mathematical or logical operations. The ear-liest computers were programmed by setting switches for operations and manually entering numbers in working stor-age, or memory. A major advance in the flexibility of com-puters came with the idea of stored programs, where a set of instructions could be read in and held in the machine in the same way as other data. These instructions were in machine language, consisting of numbers representing instructions (operations to be performed) and other numbers represent-ing the address of data to be manipulated (or an address containing the address of the data, called indirect address-ing—see addressing). Operations include basic arithmetic (such as addition), the movement of data between storage (memory) and special processor locations called registers, and the movement of data from an input device (such as a card reader) and an output device (such as a printer).

Writing programs in machine code is obviously a tedious and error-prone process, since each operation must be specified using a particular numeric instruction code together with the actual addresses of the data to be used. It soon became clear, however, that the computer could itself be used to keep track of binary codes and actual addresses,allowing the programmer to use more human-friendly names for instructions and data variables. The program that translates between symbolic language and machine language is the assembler.

With a symbolic assembler, the programmer can give names to data locations. Thus, instead of saying (and hav-ing to remember) that the quantity Total will be in location &H100, the program can simply define a two-byte chunk of memory and call it Total:

Total DB

The assembler will take care of assigning a physical mem-ory location and, when instructed, retrieving or storing the data in it.

Most assemblers also have macro capability. This means that the programmer can write a set of instructions (a pro-cedure) and give it a name. Whenever that name is used in the program, the assembler will replace it with the actual code for the procedure and plug in whatever variables are specified as operands

Applications

In the mainframe world of the 1950s, the development of assembly languages represented an important first step toward symbolic programming; higher-level languages such as FORTRAN and COBOL were developed so that program-mers could express instructions in language that was more like mathematics and English respectively. High-level lan-guages offered greater ease of programming and source code that was easier to understand (and thus to maintain). Gradually, assembly language was reserved for systems pro-gramming and other situations where efficiency or the need

During the 1970s and early 1980s, the same evolution took place in microcomputing. The first microcomputers typically had only a small amount of memory (perhaps 8–64K), not enough to compile significant programs in a high-level language (with the partial exception of some ver-sions of BASIC). Applications such as graphics and games in particular were written in assembly language for speed. As available memory soared into the hundreds of kilobytes and then megabytes, however, high level languages such as C and C++ became practicable, and assembly language began to be relegated to systems programming, including device drivers and other programs that had to interact directly with the hardware.

While many people learning programming today receive little or no exposure to assembly language, some under-standing of this detailed level of programming is still useful because it illustrates fundamentals of computer architec-ture and operation.


No comments:

Post a Comment