Lecture8 Intro To Machine and Assembly Language
Lecture8 Intro To Machine and Assembly Language
Table of Contents
1
1.1.1
Machine Language....................................................................................................... 2
1.1.2
1.2
High-Level Languages......................................................................................................... 5
1.3
Translators............................................................................................................................. 5
The figure below is intended to illustrate several key points about programming
languages. First, programming languages are built upon and relate directly to the
underlying computer (hardware). In fact, they are designed to control the operation of
the hardware. Second, these programming languages can be divided into TWO
major groups. They are:
Low-level Languages (Low Level languages are further divided in to
Machine language and Assembly language)
High-Level Languages
Page 1
1.1
Low Level Languages
The term low level means closeness to the way in which the machine has been built.
Low level languages are machine oriented and require extensive knowledge of
computer hardware and its configuration.
Page 2
i.
ii.
The programmer has to remember a lot of codes to write a program which might
easily result in program errors.
iii.
No matter how close assembly language is to machine code, the computer still
cannot understand it. The assembly-language program must be translated into
machine code by a separate program called an assembler. The assembler program
recognizes the character strings that make up the symbolic names of the various
machine operations, and substitutes the required machine code for each instruction.
At the same time, it also calculates the required address in memory for each
symbolic name of a memory location, and substitutes those addresses for the
names. The final result is a machine-language program that can run on its own at
any time; the assembler and the assembly-language program are no longer needed.
To help distinguish between the "before" and "after" versions of the program, the
original assembly-language program is also known as the source code, while the
final machine-language program is designated the object code.
Every processor has its own assembly language. For example, 8085 CPU has its
own assembly language. CPUs such as 8086, 80186, 80286 have their own
assembly languages.
Page 3
ii.
iii.
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.
ii.
iii.
Page 4
programming is typically used only for very small programs, or for segments of code
that are highly critical and must run as efficiently as possible.
1.2
High-Level Languages
Very early in the development of computers, attempts were made to make
programming easier by reducing the amount of knowledge of the internal workings of
the computer that was needed to write programs. If programs could be presented in
a language that was more familiar to the person solving the problem, then fewer
mistakes would be made.
High-level programming languages allow the specification of a problem solution in
terms closer to those used by human beings. These languages were designed to
make programming far easier, less error-prone and to remove the programmer from
having to know the details of the internal structure of a particular computer. These
high-level languages were much closer to human language.
1.3
Translators
A program is a set of instructions for performing a particular task. These instructions
are just like English words. The computer interprets the instructions as 1's and 0's. A
program can be written in assembly language as well as in high-level language. This
written program is called the source program. The source program is to be
converted to the machine language, which is called an object program. A translator
is required for such a translation.
Page 5
Figure 2: Translators
Page 6
Compilers will show errors and warnings for the statements violating the syntax rules
of the language. They also have the ability of linking subroutines of the program.
Page 7