Sie sind auf Seite 1von 4

An assembly language is a low-level programming language for computers, microprocessors,microcontrollers, and other programmable devices.

It implements a symbolic representation of themachine codes and other constants needed to program a given CPU architecture. This representation is usually defined by the hardware manufacturer, and is based on mnemonics that symbolize processing steps (instructions), processor registers, memory locations, and other language features. An assembly language is thus specific to a certain physical (or virtual) computer architecture. This is in contrast to most high-level programming languages, which, ideally, are portable. A utility program called an assembler is used to translate assembly language statements into the target computer's machine code. The assembler performs a more or less isomorphic translation (a one-to-one mapping) from mnemonic statements into machine instructions and data. This is in contrast with high-level languages, in which a single statement generally results in many machine instructions. Many sophisticated assemblers offer additional mechanisms to facilitate program development, control the assembly process, and aid debugging. In particular, most modern assemblers include a macro facility (described below), and are called macro assemblers.

assembly language, Type of low-level computer programming language consisting mostly of


symbolic equivalents of a particular computers machine language. Computers produced by different manufacturers have different machine languages and require different assemblers and assembly languages. Some assembly languages can be used to convert the code that programmers write (source code) into machine language (readable by the computer), and have functions to facilitate programming (e.g., by combining a sequence of several instructions into one entity). Programming in assembly languages requires extensive knowledge of computer architecture.
LINKS

from the Encyclopdia Britannica

Definition: Assembly Language is a low level programming language using the human readable instructions of the CPU. On PCs, the assembly language looks like this mov ebx, eax mov esi, 66 mov [edx+ebx*4+4], ecx mov [ebx], ah To understand it you need to know that eax,ebx etc are each a 32 bit register inside the CPU. The Mov instructions just copy the value so the first line is pretty much the same as this Ccode ebx = eax;

To compile this into machine code, you need an assembler. It's just a compiler for assembly language. Many compilers can output the assembly language equivalent of code in C or C++. The problem with assembly language is that it requires a high level of technical knowledge, and it's slow to write. In the same time that you take to write ten lines of assembly language- that's ten instructions, you could write ten lines of C++, perhaps the equivalent of 500 instructions!

assembly language
A programming language that is one step away from machine language. Each assembly language statement is translated into one machine instruction by the assembler. Programmers must be well versed in the computer's architecture, and, undocumented assembly language programs are difficult to maintain. It is hardware dependent; there is a different assembly language for each CPU series. It Used to All Be Assembly Language In the past, control programs (operating systems, database managers, etc.) and many applications were written in assembly language to maximize the machine's performance. Today, C/C++ is widely used instead. Like assembly language, C/C++ can manipulate the bits at the machine level, but it is also portable to different computer platforms. There are C/C++ compilers for almost all computers. Assembly Language Vs. Machine Language Although often used synonymously, assembly language and machine language are not the same. Assembly language is turned into machine language. For example, the assembly instruction COMPARE A,B is translated into COMPARE contents of memory bytes 2340-2350 with 4567-4577 (where A and B happen to be located). The physical binary format of the machine instruction is specific to the computer it's running in. They Can Be Quite Different Assembly languages are quite different between computers as is evident in the example below, which takes 16 lines of code for the mini and 82 lines for the micro. The example changes Fahrenheit to Celsius.
HP 3000 begin intrinsic read,print,binary,ascii; array buffer(0:17); array string(0:3); byte array b'string(*) = string; integer ftemp, ctemp, len; move buffer:= "Enter Fahrenheit "; print (buffer,-30,%320);

len:=read (string,-4); ftemp:= binary(b'string,len); ctemp:= (ftemp-32) * 5 / 9; len:= ascii(ctemp,1-,b'string); move buffer:= "Celsius is "; move buffer(14) := string, (-len); print (buffer,-32,%0); end

PC (Intel x86) cseg start: msgstr crlf nine five outstr start1: jmp db db db db db push push pop mov mov int start1 'Enter Fahrenheit ' 13,10,'$' 9 5 'Centrigrade is $' ds cs ds dx,offset cseg:msgstr ah,9 21h getnumb ax,ax exit ax dx,offset cseg:outstr ah,9 21h ax ax,32 c1 ax dl,'-' ah,6 21h ax ax five nine putval dx,offset cseg:crlf ah,9 21h sloop ds ah,4ch 21h bx,bx segment para public 'CODE' assume cs:cseg,ds:cseg

sloop: cent:

call test je push mov mov int pop sub jns push mov mov int pop neg cl: mul div call mov mov int jmp exit: pop mov int getnumb: xor

llp:

mov mov int cmp je sub jb cmp ja xor shl add shl shl add jmp llr: mov mov int mov ret putval: xor push mov llg: xor div add push test jne bloop: pop test je mov int jmp endx: ret cseg ends end

dl,0ffh ah,1 21h al,0dh llr al,'0' llr al,'9' llr ah,ah bx,1 ax,bx bx,1 bx,1 bx,ax llp dx,offset cseg:crlf ah,9 21h ax,bx bx,bx bx bx,10 dx,dx bx dx,'0' dx ax,ax llg dx dx,dx endx ah,6 21h bloop start

Das könnte Ihnen auch gefallen