Documente Academic
Documente Profesional
Documente Cultură
other programmable devices. It is not just a single language, but rather a group of languages.
Assembly language implements a symbolic representation of the machine code needed to
program a given CPU architecture.Also known as assembly code. The term is often also used
synonymously with 2GL.
An assembler is a type of computer program that interprets software programs written in
assembly language into machine language, code and instructions that can be executed by a
computer. An assembler enables software and application developers to access, operate and
manage a computer's hardware architecture and components. An assembler is sometimes referred
to as the compiler of assembly language. It also provides the services of an interpreter.
Advantages Assembly Language:
1.The symbolic programming of Assembly Language is easier to understand and saves a lot of
time and effort of the programmer.
2. It is easier to correct errors and modify program instructions.
3. Assembly Language has the same efficiency of execution as the machine level language.
Because this is one-to-one translator between assembly language program and its corresponding
machine language program.
Disadvantages Assembly Language:
1.One of the major disadvantages is that assembly language is machine dependent. A program
written for one computer might not run in other computers with different hardware configuration.
2. What is the difference between procedure and macro ?
Macro
Procedure
3. What is assembly statement? What are the rules for declaring namefield in assembly
language?
SolutionThe layout of a machine instruction is part of the architecture of a processor chip. Without
knowing the layout you can't tell what the instruction means. Even if you know the layout, it is
hard to remember what the patterns mean and hard to write machine instructions.
A statement in pure assembly language corresponds to one machine instruction. Assembly
language is much easier to write than machine language. Here is the previous machine
instruction and the assembly language that it corresponds to:
Machine instruction
add $t0,$t1,$t2
The instruction means: add the integers in registers $t1 and $t2 and put the result in register
$t0. To create the machine instruction from the assembly language statement a translation
program called an assembler is used.
4. what are the differences between machine language and assembly language?
Machine code is the only form of program instructions that the computer hardware can
understand and execute directly. All other forms of computer language must be translated into
machine code in order to be executed by the hardware. Machine code consists of many strings of
binary digits that are easy for the computer to interpret, but tedious for human beings to interpret.
Machine code is different for each type of computer. A program in machine code for an Intel
x86-based PC will not run on an IBM mainframe computer, and vice versa.
Assembly language is a symbolic representation of machine code, which allows programmers to
write programs in machine code without having to deal with the long binary strings. For
example, the machine code for an instruction that adds two numbers might be 01101110, but in
assembly language, this can be represented by the symbol ADD. A simple assembler program
translates this symbolic language directly into machine code. Because machine code is specific
to each type of computer hardware, assembly languages are also specific to each type of
computer. However, all machine languages and assembly languages look very similar, even
though they are not interchangeable.
Compiler: It is a program which translates a high level language program into a machine language
program. A compiler is more intelligent than an assembler. It checks all kinds of limits, ranges, errors
etc. But its program run time is more and occupies a larger part of the memory. It has slow speed.
Because a compiler goes through the entire program and then translates the entire program into
machine codes. If a compiler runs on a computer and produces the machine codes for the same
computer then it is known as a self compiler or resident compiler. On the other hand, if a compiler
runs on a computer and produces the machine codes for other computer then it is known as a cross
compiler.
Linker: In high level languages, some built in header files or libraries are stored. These libraries are
predefined and these contain basic functions which are essential for executing the program. These
functions are linked to the libraries by a program called Linker. If linker does not find a library of a
function then it informs to compiler and then compiler generates an error. The compiler automatically
invokes the linker as the last step in compiling a program. Not built in libraries, it also links the user
defined functions to the user defined libraries. Usually a longer program is divided into smaller
subprograms called modules. And these modules must be combined to execute the program. The
process of combining the modules is done by the linker.