BEST Programming Languages – A Brief Introduction

At the first developed computers, electronics was the need to program them, that is, to store in memory the information about the task they were to perform. The former are used as simple calculators; are indicated in the footsteps of calculation , one by one.

John Von Neumann developed the model that bears his name, to describe this concept of ” program stored “. In this model, there is an abstraction of the memory as a set of cells, which store just numbers. These numbers can represent two things: the data on which the program will work; or the program itself.

How do you describe a program like numbers? The problem is had to represent actions to be undertaken by the computer , and memory, to be composed of switches corresponding to the concept of bit, only allowed us to store binary numbers.

The solution adopted was the following: each action that is able to perform our computer, associate a number, which will be your code of operation (opcode). For example, a simple programmable calculator could assign opcodes:

1 = SUM, 2 = SUBTRACT, MULTIPLY 3 =, 4 = DIVIDE.

Suppose we want to perform operation 5 * 3 + 2, calculator described above. Daughter, we could “write” the program as follows:

Location Opcode Meaning Comment 0 5 5 In this town, we have the first issue of formula 1 3 * In this town, we have the opcode representing multiplication. 2 3 3 In this town, we have the second number of formula 3 1 + At this location, we have the opcode representing the sum. 4 2 2 In this town, we have the latest issue of the formula

We can see that this representation is simple express operations that is capable of the hardware (in this case, our imaginary calculator), in memory.

The description and use of opcodes is what we call language machine. That is, the list of codes that the machine is to be interpreted as instructions, describes the capabilities of programming we have it; is the language most primitive, it depends directly on the hardware, and requires the programmer to know the functioning of the machine at the lowest level.

the most primitive languages ​​were the machine languages. This, because the hardware was developed by software , plus any software finally has to be expressed in language that manages the hardware.

Programming at the time was extremely tedious, because the developer had to “get off” to level the machine and tell you, step by step, each point of the task he had to perform. Furthermore, it should be expressed in numerical form; and of course, this process was prone to errors, so that the productivity of the developer was very limited. However, remember that at this time, there was simply no alternative yet.

The first breakthrough came, as already noted, was the abstraction provided by the language Assembler , and with it the birth of the first tools to generate automatic machine code. This reduced the trivial mistakes, as could be the number corresponding to an operation that is extremely cumbersome and difficult to detect, but easy to make. However, even here it is easy for the programmer to make mistakes and miss logic , it must descend to the level of how the working CPU , and a good understanding of everything that happens within it.

With the development in the 50s and 60s of algorithms at a higher level, and increasing power of hardware, they began to enter the use of computer scientists from other branches; they knew a lot about physics , chemistry and other similar branches, but not of Computing , and of course, they were extremely difficult to work with assembly language instead of formulas. Thus was born the concept of High-level Language, the first compiler FORTRAN (Formula Translation), which, as its name suggests, began as a “simple” effort to translate a formula language, assembler language and therefore the machine language. From FORTRAN, many languages ​​have been developed that follow the same concept: to seek the greatest possible abstraction, and the programmer’s life easier, increasing productivity and entrusted the compilers or interpreters to translate the high-level language, the language of computer.

It should be noted the existence of languages ​​that combine features of high-level and low-level (ie, Assembler). My favorite example is C: contains structures of high level programming, and ease of use libraries that are also high-level features; however, was designed with few instructions, which are very simple, easy to translate into machine language; and requires a proper understanding of how the machine works, the use of the memory, etc.. Therefore, many people consider languages ​​like C (which was designed for systems operating), mid-level languages.

Java

The programming language Java , was designed by Sun Microsystems Inc, in order to create a language that could run on networks heterogeneous computing ( computer networks consisting of more than one type of computer, whether PC, MAC’s, stations work , etc..), and was independent of the platform on which it will run. This means that a Java program can run on any machine or platform. The language was designed with the following features in mind:

  • Simple. Eliminates the complexity of languages ​​like “C” and opened the context of modern object-oriented languages. Object Oriented. The philosophy of object-oriented programming is different from conventional programming.
  • Family. Since most programmers are used to program in C or C + +, Java syntax is very similar to these.
  • Robusto. The system handles Java computer memory for you. You do not have to worry about pointers, memory that is not being used, etc.. Java does all this without one tells.
  • You sure. The Java system has certain policies that prevent can codify virus with this language. There are many restrictions, especially for applets, which limit what can and can not do with the resources critical to a computer.
  • Portable. As the compiled Java code (called byte code) is interpreted, a compiled Java program can be used by any computer that has implemented the Java interpreter.
  • Independent of architecture . When you compile a Java program, the resulting code a type of binary code known as byte code. The Captcha code is interpreted by different computers in the same way, only need to implement an interpreter for each platform. That way Java manages to be a language that does not depend on a defined computational architecture.
  • Multithreaded. A language that supports multiple threads is a language that can run different lines of code at the same time .
  • Interpreted. Java runs on virtual machine, so it is interpreted.
  • Dynamic. Java does not require that you compile all the classes in a program to make this work. If you make a change to a class Java is responsible for performing a Dynamic or Dynamic Loading Bynding to find the classes.

Java can run as a single application or as an “applet”, which is a small program made ​​in Java. Java applets can “stick” to a page Web ( HTML ), and this can have a program that any person with a compatible browser to use.

Note: Difference between Java and CGI The difference is essentially simple, a CGI running on the server while a Java program running on the user’s machine.

Java works as follows: The Java compiler leaves the program in a pseudo-code (not mechanical code) and then the Java interpreter executes the program (which is known as the “Java Virtual Machine”). So Java is cross platform, there is an interpreter for each different machine. Note: The machine-code is the binary code that the computer can understand and execute.

To understand as a Java applet works see the following example:

  1. A Java code on a Web server. (Java codes are characterized by having the *. Class).
  2. A person on the Internet with a browser compatible with Java, makes a connection to the server.
  3. The server sends the HTML document and the Java code (*. Class).
  4. In computer hacker get both, and the Java Virtual Machine, which is in the browser, transforms the Java code in a code that understands the local machine and the program within the Web page is executed.
  5. If the user makes another connection to another URL, or exit the browser, the program stops executing on the computer and no trace of the.

Example Java tutorial:

In Java there are three types of comments:

/ / For a single line comments

/ * Comments of one or

more lines

* /

/ ** Review documentation of one or more lines

* /

The first two types of reviews are what every programmer knows and are used the same way. Documentation comments placed immediately before a statement (variable or function ) indicate that comment must be placed in the documentation that is automatically generated when the Java, javadoc is used. These comments serve as a description of the item stated allowing generate written documentation of our classes while the code is generated.

In this type of comment for documentation, allowed introduction of some tokens or keywords, that will make the information that follows them appear different from the rest of the documentation form.

Identifiers

Identifiers named variables , functions , classes and objects; anything that the developer need to identify or use.

In Java, an identifier begins with a letter, an underscore (_), or dollar sign ($). The following characters can be letters or digits. Case-insensitive and no maximum length.

Unix

Example of Unix :

Not all the “tree” of directories consists of user directories. There are many of them that are commonly used or the system itself and those who have to become familiar. The most important are:

/

The root, which “hang” all.

/ Bin and / usr / bin

Contains commands executable UNIX.

/ Etc

It is perhaps the most important directory. Contains data files and system configuration, the password file, terminal configuration, network , etc. (hence its name).

/ Dev

File I / O devices

/ Usr / man

Manual

/ Tmp

Directory for temporary fixes. All users can read and write to it.

C

C is a programming language designed by Dennis Ritchie of Bell Laboratories, and

was installed on a PDP-11 in 1972; was designed to be the language of the Operating Systems

Unix1. In turn, UNIX is an operating system developed by Ken Thompson, who

used assembly language and a language called B to produce the original versions of UNIX in 1970. C was invented to overcome the limitations of B.

C is a mature general purpose language which evolved from these roots;

its definition appears in 1978 in “ Appendix C Reference Manual ” the book The C

Programming Language, by Brian W. Kernighan and Dennis M. Ritchie (Englewood Cliffs,

New Jersey, Prentice-Hall 1978), but the latest recommended standard appeared in

June 1983, in Bell Laboratories document entitled The C Programming

Language-Reference Manual, written by Dennis M. Ritchie

A program in C

Generally speaking, a C program consists of three sections. The first section is where all the “ headers”. These are commonly “ headers” the “ # define” and “ # include”. As the second section are “ functions”. Like Pascal , C all functions that are to fill in the program must go before the main function (main ()). Declaring functions to fill the top of the program, it makes the main function is before the rest of the functions. Now, speaking only function because in C there are no procedures .

And last section has the main function called main. When the program runs, the first thing this function is executed, and then follow the rest of the program.

The symbols {y} indicate “ begin” and “ end” respectively. If a function or a while loop, for example, the content is only one line, it is not necessary to use “ keys” ({}), otherwise it is required to use them.

Example of a C program

/ * Sample program that displays the content of "ROL" screen * /

# Include stdio.h

# Define ROL "9274002-1"

despliega_rol () {

printf ("My role is: % s n", ROL);

}

void main () {

despliega_rol ();

}

/ * End of program * /

Pascal

Pascal is a programming language of high level general purpose; ie can be used to write programs for scientific and commercial purposes.

The programming language Pascal was developed by Professor Niklaus (Nicholas) Wirth in Zurich, Zuiza the end of the 1960s and early 70s. Wirth designed this language to be a good first programming language for people starting to learn programming. Pascal has a relatively small number of concepts to learn and master. Its design makes it easy to write programs using a style that is generally accepted as standard practice good programming. Another goal of the design was the easy implementation Wirth. He designed a language for which it was easier to write a compiler for a new kind of computer.

Sorting program;

{

This program reads a natural and a sequence of N characters from standard input; builds an index to sort low to high and prints out the sorted sequence.

}

CRT uses;

Const Max = 10;

Space = '';

Enter = chr (13);

type Index = 1 .. Max;

Quantity = 0 .. Max;

SecOfChar = record

elems: array [index] of char;

ult: Number;

end;

SecOfInd = record

elems: array [index] of Index;

ult: Number;

end;

Natural = 0 .. MaxInt;

PosMin function (idx: SecOfInd, i:, s: SecOfChar): Number;

{Returns the index position idx in the minor character in s to

positions> = i. }

var j: Index;

pm: Number;

begin

if i> idx.ult then

pm: = 0

else begin

pm: = i;

for j: = i +1 to idx.ult do

if s.elems [idx.elems [j]] <s.elems [idx.elems [pm]] then

pm: = j;

end;

PosMin: = pm;

end;

procedure Swap (var idx: SecOfInd, i, j: index);

{Swap the positions ij idx. }

var tmp: Index;

begin

if (i <= idx.ult) and (j <= idx.ult) then begin

tmp: = idx.elems [i];

idx.elems [i]: = idx.elems [j];

idx.elems [j]: = tmp;

end;

end;

InicInds procedure (var idx: SecOfInd; cant: Index);

{Construct the sequence of indices 1,2,3, ..., n. Index will

Home for the ordering of a sequence of characters

c1, c2, ..., cn. }

var n: Natural;

begin

n: = ct;

idx.ult: = n;

while n> 0 do begin

idx.elems [n]: = n;

n: = n-1;

end;

end;

InicSecChar procedure (var s: SecOfChar);

{Returns the empty sequence. }

begin

s.ult: = 0;

end;

Full function (s: SecOfChar): Boolean;

begin

Full: = s.ult = Max;

end;

{PRE: not Full (s)}

InsCar procedure (var s: SecOfChar c: char);

{Inserts the character c in the string s}

begin

s.ult: s.ult + = 1;

s.elems [s.ult]: = c;

end;

IndSelSort procedure (s: SecOfChar; var ind: SecOfInd);

{Build the index ordering the sequence s. Sort index

initial 1,2, ..., n by the method of selection sort}

var i:;

begin

InicInds (ind, s.ult);

for i: = 1 to ind.ult-1 do begin

Swap (ind, i, PosMin (ind, i, s));

end

end;

WriteSorted procedure (idx: SecOfInd, s: SecOfChar);

{Print to stdout orderly sequence s according to the

index idx}

var i:;

begin

write ('Order');

for i: = 1 to idx.ult do

write (s.elems [idx.elems [i]], '');

writeln;

end;

LeerCar procedure (var c: char; var ok: boolean; sep: Char);

{Read from standard input one character followed by the character Sep}

var c1, c2: char;

begin

c: = ReadKey; write (c);

c1: = ReadKey; write (c1);

ok: = c1 = Sep;

end;

LeerSecOfChar procedure (var s: SecOfChar; cant: Natural, var ok: Boolean);

{Build a sequence of characters provided by the cant

procedimeinto LeerCar. If you cant> truncated Max. }

var right: Boolean;

i: Natural;

ch, sep: Char;

begin

writeln ('Enter' cant, 'separated by white characters Enter to finish.');

write ('>');

InicSecChar (s);

i: = 1;

ok: = true;

Sep: = Space;

ok and while (i <= qty) and not Full (s) do begin

if i cant then = sep: = Enter;

LeerCar (ch, well, sep);

i: = i +1;

ok: = ok and good;

if ok then

InsCar (s, ch);

end;

end;

LeerCant procedure (var n: Natural);

{Read from standard input a natural <= Max}

begin

repeat

writeln ('Enter number of characters (<=', Max, ')');

write ('>');

readln (n);

until n <= Max;

end;

Continue procedure (var go: Boolean);

var car: Char;

begin

writeln;

writeln ('Other (s / n)?');

write ('>');

car: = ReadKey;

writeln (car);

follow: = car in ['s', 'S'];

end;

var ct: Natural;

cars: SecOfChar;

inds: SecOfInd;

follow, ok: boolean;

begin

repeat

ClrScr;

LeerCant (ct);

LeerSecOfChar (cars, cant, ok);

if ok then begin

IndSelSort (cars, inds);

writeln;

WriteSorted (inds, cars);

end

else begin

writeln;

writeln ('data error');

end;

Continue (continue);

until not follow;

end.

QBasic

Qbasic is a high level language, which consists of instructions that humans can relate to and understand. The Qbasic compiler is responsible for translating it into machine language.

A program is a sequence of instructions. The process of executing these instructions is called running the program. The programs contain functions of input, processing and output. The person who solves problems by writing computer programs known as programmer. After analyzing the problem and develop a plan to solve it, write and test the program instructs the computer how to carry out the plan. The procedure performed by the developer is defined as “problem solving”. But it is necessary to specify a programmer and a user are not the same. A user is anyone who uses the program.

Qbasic example to make a calculator

Total DIM AS DOUBLE

DIM number AS DOUBLE

AS DOUBLE DIM SecondNumber

AS STRING DIM more

AS STRING DIM moreNumbers

AS STRING DIM operation

Total = 0

more = "y"

moreNumbers = "c"

CLS

WHILE more = "y"

INPUT "Enter the first number"; number

Total = number

WHILE moreNumbers = "c"

COLOR 14

PRINT "The Total is:"; total

7 COLOR

PRINT "Select an operation"

COLOR 2

PRINT "(+)"

5 COLOUR

PRINT "(-)"

COLOR 1

PRINT "(x)"

4 COLOR

INPUT "(/)"; operation

7 COLOR

CLS

IF operation = "+" THEN

REM where we do additions

PRINT "Enter the number to Add to"; total

INPUT SecondNumber

Total = total + SecondNumber

COLOR 14

PRINT "The Total is now:"; total

7 COLOR

ELSE

IF operation = "-" THEN

REM subtraction

PRINT "Enter the number to Subtract from"; total

INPUT SecondNumber

total = total - SecondNumber

COLOR 14

PRINT "The Total is now:"; total

7 COLOR

ELSE

IF operation = "x" THEN

REM multiplication

PRINT "Enter the number to Multiply"; Total; "By"

INPUT SecondNumber

* Total Total = SecondNumber

REM * is the multiplication sign in programs

COLOR 14

PRINT "The Total is now:"; total

7 COLOR

ELSE

IF operation = "/" THEN

REM division

PRINT "Enter the number to Divide"; Total; "By"

INPUT SecondNumber

= 0 THEN IF SecondNumber

4 COLOR

PRINT "You can not divide by zero"

7 COLOR

ELSE

total = total / SecondNumber

REM / is the division sign in programs

END IF

COLOR 14

PRINT "The Total is now:"; total

7 COLOR

ELSE

PRINT "you must select an operation"

END IF

END IF

END IF

END IF

INPUT "Do you wish to continue (c) or start with new numbers

(N) "; moreNumbers

CLS

WEND

COLOR 14

PRINT "The Grand Total is:"; total

7 COLOR

INPUT "Do you wish to make more calculations (y - n)"; more

moreNumbers = "c"

REM if we do not put "moreNumbers" back to and it will always

REM to come back "Do you wish to make more calculations" and never ask REM

for numbers again

REM (try it)

Total = 0

REM if we do the full reset to 0, it will just

REM keep on adding to the overall

WEND

END

Linux

Linux is an implementation of the UNIX operating system (one more of the many clones of Unix history), but the originality of being free, yet very powerful, which stand out very well (not infrequently victorious) when compared with the versions commercial for larger systems and therefore theoretically superior. It began as a project staff of then-student Linus Torvalds, who took as the starting point of another old acquaintance, Andy Minix. S. Tanenbaum (professor of operating systems created their own Unix operating system on PCs XT for use in his teaching ). Currently Linus continues to develop, but at this point the main author is the Internet, where a gigantic family of developers and users contribute daily time increasing their benefits and providing information and mutual support. The original version, and even began to dominant-compatible PCs (Intel 386 and higher), there also developing versions for virtually all platforms:

PowerPC < http :/ / www.cs.us.es/archive/linuxppc/>,

<http://www.geog.ubc.ca/sparclinux.html> Sparc,

<http://www.azstarnet.com/~axplinux> Alpha,

Mips <http://www.fnet.fr/ linux -mips />, etc.

Of these the most recent version is currently <http://www.mklinux.org> PowerMac (Apple PowerPC) based on the Mach 3.0 microkernel and already there is a distribution supported directly by Developer Apple and OSF while retaining the spirit (free, free distribution, etc.) of the original version. A server’s just try a few days ago and has been pleasantly surprised (still have sooooo many faults, but to be an early draft and the short time he has launched, you are more than I expected).

Example linux:

Compiling the Kernel

Since disk will only hold 1.44 Megabytes (1440 Kilobytes) data, can not you use the same kernel to diskette. First you get the sources of the kernel and unzip in / usr / src / linux. Then run the following command from the directory

/ Usr / src / linux:

make config

Set only what you really need. I personally only setup support for “ext2”, support for the floppy disk drive (floppy disk), and support for “PPP”. Your settings may be different depending on what you set up. Now enter the following command:

make dep; make clean; make zImage

Make zImage is very important! Compress the final kernel. After you finish the compilation, you must find the new kernel in / usr/src/linux/arch/i386/boot under

zImage name.

The filesystem: Not only is a set of files

Now we have to create the file system (in English : filesystem, fs) for the diskette. Instead of copying the files which such directly to disk, the compress before copying. This will make it slightly more difficult to modify anything permanently. First you type the following

command:

dd if = / dev / zero of = [DEVICE] bs = 1k count = 3000

Where [DEVICE] is “place” in the hard drive where you will store the uncompressed filesystem. Then enter the following command and press ENTER, substituting [DEVICE] through the directory on your hard drive where you saved the uncompressed filesystem:

mke2fs-m 0 [DEVICE]

If make2fs asks if you really want to do this (Do you really want to do this?) Accepts typing “y” (yes).

Then we have to mount this filesystem we created. To do this, you use the kernel must allow “mount files”, in other words, must have enabled the possibility of “loopback devices”. To do this you have to compile the kernel on your machine (not the core that we have created, but to your own machine) with the option:

Loopback device support (CONFIG_BLK_DEV_LOOP) [M / n / y /?]

well as a module (M) or in the same core (Y). If you compile it as a module (as recommended) then you have to insert the module modprobe loop! Do not forget to reboot your machine if you had to recompile the kernel!

mount-t ext2 DEVICE / mnt

If the mount command complains you can try with the following command:

mount-o loop-t ext2 DEVICE / mnt

Now you must copy all the files you need on the new file system. First, put in the / mnt directory ( cd / mnt) and creates the following directories:

/ Dev

/ Pro

/ Etc

/ Bin

/ Lib

/ Mnt

/ Usr

Now create the / dev directory by typing the following:

dpR-cp / dev / mnt / dev

If you run out of disk i-nodes, you can go to / mnt / dev and delete files device you do not need. When you have finished copying the files required for / dev, go to / etc. To be safe copy all files from / etc to / mnt / etc:

dpR-cp / etc / mnt / etc

Then copy all the directory / lib to / mnt:

cp-dpR / lib / mnt / lib

For the / bin directory copy, Believe only what you need in / mnt / bin.

Copy all your diskette

Now we have to copy all the / the diskette / s. To do this, we must now compress the file system by typing the following commands:

cd /

umount / mnt

dd if = [DEVICE] bs = 1k | gzip -9> rootfs.gz

Now it is important to check the size of the nucleus. Go to / usr/src/linux/arch/i386/boot and type “ls-l”. Then divide the core size by 1024.

For example, if the size is 250000 bytes, then it is 245 KB. Henceforth, replaces [ROOTBEGIN] appears in orders by the total number of kilobytes that you calculated. Now copy the kernel to diskette with the following command:

dd if = zImage of = / dev/fd0

This command will save the kernel on the disk. Then enter the following command for the kernel to find the root filesystem on the diskette.

rdev / dev/fd0 / dev/fd0

Now you have to do a little calculating in hex. Add 4000 to the hex equivalent of [ROOTBEGIN] (which in our example is F5). Converts the result to decimal and type the following command, replacing 16629 with the result that you got:

rdev-r / dev/fd0 16629

Finally, type the following to copy the disk file system:

dd if = / rootfs.gz of = / dev/fd0 bs = 1k seek = [ROOTBEGIN]

The root filesystem will be copied to disk right after the kernel. You got it! For the second disk, the process is easier. Copy the files you want onto the floppy. However, to use the files in the second disk, you must enter the following after booting with the disk:

mount / dev/fd0 / usr

Assembly language

When we abstract opcodes and replace it with a word that is a key to its meaning, which is commonly known as a mnemonic, we have the concept of Assembly Language. Thus, we can simply define the Assembly Language as follows:

Assembly Language is the first abstraction of Machine Language, consisting of associating keywords opcodes to facilitate their use by the programmer

As you can see, the Assembly Language is directly translatable into machine language and vice versa; it is simply an abstraction that facilitates its use for humans. On the other hand, the computer understands directly to Assembly Language; necessary to translate machine language. Originally, this process was done by hand, using tables where this leaves similar program to the calculator example we saw above written. But, being so direct the translation , soon appeared Assemblers programs, which are translators that convert the source code (Assembly Language) to object code (ie, a Machine Language).

One feature which should be noted is that the hardware dependent these languages, there is a distinct Machine Language (and therefore a different Assembly Language) for each CPU. For example, we can mention three completely different languages, yet come from the application of the above concepts:

1.Languaje Assembler family 2.Languaje Intel Assembler 80×86 Family Motorola 68000 Assembler 3.Languaje processor POWER, used in IBM RS/6000.

We have 3 different manufacturers competing against each other and each applying different concepts in the manufacturing of its processors , architecture and programming; all these aspects influence the machine language and assembler change enough.

Advantages and disadvantages of Assembly Language

Once we have seen the evolution of languages, the question arises: In these “modern” times, what I want the Assembly Language?

The process of evolution brought some disadvantages, now we will see the benefits of using Assembly Language, about a high-level language:

1.Velocidad

2. Efficiency of size

3.Flexibilidad

On the other hand, as a more primitive language, the assembler has certain disadvantages with respect to high level languages:

1.Tiempo major source of programming 2.Programas 3.Peligro resources unexpectedly affect portability 4.Falta

Speed

The translation process performed by interpreters, involves a process of additional computation to which the developer wants to do. Therefore, we find that an interpreter is always slower than performing the same action in Assembly Language, simply because it has the cost of being further translating the program, every time I run.

Hence the two compilers, which are much faster than interpreters thus make the translation once and leave the object code, which is already Machine Language, and can run very quickly. Although the translation process is more complex and costly than joining a program, normally we despise, against the advantages of encoding the program faster.

However, most of the time, the code generated by a compiler is less efficient than the equivalent code that a programmer would write. The reason is that the compiler does not have much intelligence , and needs to be able to create generic code, that serves as both a program to another; in exchange , a human programmer can exploit specific characteristics of the problem, reducing the generality but at the same time not wasted any instruction, any process that does not need.

To give an idea, on a PC, and assuming that they are all good programmers, a program to sort a list take about 20 times in Visual Basic (an interpreter), and 2-fold increase in C (compiler), the equivalent in Assembler.

So when it reviewed the speed of the program, Assembler becomes a logical candidate as a language.

Now this is not an absolute; well done in C program can be many times faster than a poorly made ​​program in Assembler; remains extremely important to the proper choice of algorithms and data structures. Therefore, it is recommended to first seek to optimize these aspects, in the language you want, and only use assembler when more optimization is required and can not be achieved by these means .

Size

For the same reasons we saw in the aspect of speed, compilers and interpreters generate machine code more than necessary; therefore, the executable program grows. Thus, when it is important to reduce the size of the executable, improving memory usage and also having benefits in speed, may agree to use the Assembler language. Among the programs that is critical minimal use of memory, we have the virus and device drivers (drivers). Many of them, of course, are written in Assembler language.

Flexibility

The above reasons are a matter of degree: we can do things in another language, but we want them more efficiently. But all high-level languages ​​have limitations in monitoring ; to make abstractions, limit their own ability. I mean, there are tasks that the machine can do, but a high-level language allowed. For example, in Visual Basic you can not change the resolution of the monitor program medium; is a limitation imposed by the abstraction of the GUI Windows . However, assembly is very simple, because we have direct access to the hardware monitor.

In short, the flexibility is to recognize the fact that

All that can be done with a machine, can be done in assembly language of this machine; High-level languages ​​have limitations in either to exploit the resources of the machine form.

Programming time

When low-level Assembly Language instructions required to perform the same process, compared to a high-level language. On the other hand, requires more care by the programmer, it is prone to logic errors are reflected more strongly in the execution.

For all this, it is slower to develop comparable programs in Assembly Language that in a high level language, as the developer has a lower abstraction.

Large source programs

For the same reasons that increases the time, the source programs grow; simply, we need more instruction primitives to describe processes equivalent. This is a disadvantage because it hinders the maintenance program, and again reduces the productivity of programmers.

Danger of resources affect unexpectedly

We have the advantage that all that can be done on the machine, do the Assembly Language (flexibility). The problem is that every mistake we can make, or such risk we may have, we also have it in this language. In other words, have much power is useful but also dangerous.

In practical life, fortunately does not happen much; however, the program in this language will see that it is much more common than the machine will “hang”, “block” or “squeeze out the air”; and reinitialize it. Why?, Because this language is perfectly possible (and simple) instructions perform invalid sequences that normally do not appear when using a high level language.

In some extreme cases, it can be overwritten information CMOS machine (I have not seen riskier effects); but, if not conserved, this can cause us to stop “see” the hard drive, along with all your information.

Lack of portability

As already mentioned, there is an assembly language for each machine; therefore, obviously is not a selection of appropriate language when we want to encode into a machine and then bring the programs to other operating systems or models of computers. While this is a general problem for all languages, it is much more noticeable in assembly: I can reuse 90% or more of the code development in “C” on a PC, to take it to an RS/6000 UNIX, and so if after I take it to a Macintosh, provided it is done right and follow the standards of “C” and the principles of structured programming. Instead, if we write the program in the PC Assembler, however well you develop and follow many standards, we will have to rewrite almost 100% of the code to bring it to UNIX, and again to take it to the same Mac

Bibliography:

http://docs.inf.utfsm.cl/pub/DI/labsw/manual_c/node3.html

http://highland.dit.upm.es:8000/UNIX/movs1/2dirsist.html

http://docs.inf.utfsm.cl/pub/DI/labsw/manual_c/node1.html

http://docs.inf.utfsm.cl/pub/DI/labsw/manual_c/node2.html

Peter Abel. IBM PC Assembly Language and Programming. Fourth Edition. Prentice Hall. 1997.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top