Sie sind auf Seite 1von 15

Assembly language

Assembly language

Anassembly

language(orassembler
language) is alow-level programming
languagefor acomputer, or other
programmable device, in which there is a
very strong (generallyone-to-one)
correspondence between the language and
thearchitecture'smachine code
instructions.

Each

assembly language is specific


to a particular computer
architecture, in contrast to
mosthigh-level programming
languages, which are
generallyportableacross multiple
architectures, but
requireinterpretingorcompiling.

Assembly

language is converted
into executable machine code by
autility programreferred to as
anassembler; the conversion
process is referred to
asassembly, orassemblingthe
code.

Assembly

language uses amnemonicto


represent each low-level machine instruction
oroperation. Typical operations require one
or moreoperandsin order to form a complete
instruction, and most assemblers can
therefore take labels, symbols and
expressions as operands to represent
addresses and other constants, freeing the
programmer from tedious manual
calculations.

Low-Level Language
Definition - What does Low-Level Language mean?
Low-level language is a programming language that
deals with a computer's hardware components and
constraints. It has no or a minute level of
abstraction in reference to a computer and works
to manage a computer's operational semantics.
Low-level language may also be referred to as a
computers native language.

2 examples of Low Level Language


Assembly

Language - is a group of languages that


implements a symbolic representation of the machine code
required to program certain CPU architecture. It is a
programming language for microprocessors and other
programming devices, and it is the most basic programming
language available for any processor.

Machine

Language - is a programming language that can be


directly understood by a computer without interpretation.
It is also referred to machine code or object code. If a
program is written in a high-level language such as Java or
C, the program is translated into machine language by an
assembler, compiler or interpreter.

High Level Language


Sometimes

abbreviated as HLL, a high-level language is a


computer programming language that isn't limited by the
computer, designed for a specific job, and is easier to
understand. It is more like human language and less like
machine language. However, for a computer to
understand and run a program created with a high-level
language, it must be compiled into machine language.

The

first high-level languages were introduced in the


1950's. Today, there are many high-level languages in use,
including BASIC, C, C++, Cobol, FORTRAN, Java, Pascal,
Perl, PHP, Python, Ruby, and Visual Basic.

Wrong concepts about Assembly Language


Assembly

is hard to learn.
Assembly is hard to read and understand.
Assembly is hard to debug.
Assembly is hard to maintain.
Assembly language programming is time
consuming.
Today, machines are so fast that we no longer
need to use assembly.

Whats Right With Assembly Language?


An

old joke goes something like this: There are


three reasons for using assembly language:
speed,speed, and more speed. Even those who
absolutely hate assembly language will admit that
if speed is your primary concern, assembly
language is the way to go. Assembly language has
several benefits:

Speed. Assembly language programs are


generally the fastest programs around.
Space. Assembly language programs are often
the smallest.
Capability. You can do things in assembly which
are difficult or impossible in HLLs.
Knowledge. Your knowledge of assembly
language will help you write better programs,even
when using HLLs.

Number Systems
We

humans use decimal number system as the basis for our daily
computing activities. But how about Computers? Do they use
decimals too?
No. Computers use different number system, called binary.

Decimal
Binary

numbers use 10 symbols (0,1,2,39) called digits.

numbers use only two symbols (0, and 1) called bits.

third binary system, hexadecimal (hex for short) can be used


as a convenient shorthand representation of the binary
numbers inside a computer. It uses 16 symbols (0,1,2,3
9,A,B,C,D,E,F) called hex digits
(For this reason hexadecimal as well as binary numbers are important
in the computer field)

Positional number systems


Decimal,

binary and hexadecimal are all positional number systems.

In a positional number system, each position is associated with a different


weight.
Ex. In the Decimal number 25.4, the weights of the three positions, from right to
left, are 1/10, 1, and 10.
2

5 . 4

10 1

1/10 weights

The weight of each position determines how much the digit in that position
contributes to the value of the number.
For example, because the 2 in 25.4 occupies the 10s position ( i.e., the position
with weight 10), it contributes 2 x 10 = 20 to the value of the number. The value
of a decimal number is the sum of each digit times its weight. Thus the value of
25.4 is:
2 x 10 + 5 x 1 + 4 x 1/10

In

a decimal number, weights increase by a factor of 10 from


right to left from one position to the next. The weight of the
position to the immediate left of the decimal point is always 1.
because decimal numbers have 10 symbols (0 to 9), and have
weights that increase by a factor of 10, we call decimal a base
10 or radix 10 positional number system.

We

call the period in a number that divides the whole part


from the fractional part the radix point. When we are dealing
with decimal numbers, we usually call the radix point as
decimal point.

While in binary and hexadecimal numbers, we can similarly


call the radix point the binary point and hexadecimal point,
respectively.

Binary

is the base 2 positional number system. Thus, in


the binary number 1011.1, the weights of each position
increase by a factor of 2 from right to left. As in decimal,
the position to the intermediate left of the radix point
has weight 1. thus, in the binary number 1011.1, the
weights are
1 0 1 1 . 1
8 4 2 1 .

weights (in decimal)

and its value in decimal is


1x8 +0x4 +1x2

+1x1

+ 1 x = 11.5

Das könnte Ihnen auch gefallen