Topic List

Click a topic to learn more.


Term of the Moment

file manager


Look Up Another Term


Definition: assembly language


A programming language that is one step away from machine language. Each assembly language statement is translated into a machine instruction by the assembler. Programmers must be well versed in the computer's architecture, and, undocumented assembly language programs are especially difficult to maintain, but so are all undocumented programs. Assembly languages are hardware dependent; there is a different one 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. See compiler.

Assembly Language vs. Machine Language
Although the terms are often used synonymously, assembly language and machine language are not the same. Assembly language is converted to machine language. For example, the assembly instruction compare a,b might be translated into the machine instruciton COMPARE the contents of bytes 32340-32350 with bytes 54567-54577 (where the data a and b happen to be located in RAM at the moment). The actual machine instruction is in a binary format specific to the computer it is running in. See machine language and machine instruction.

They Can Be Quite Different
Assembly languages are quite different between computers as is evident below, which takes 16 lines of code for the HP and 82 lines for the x86. This 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    segment para public 'CODE'
          assume  cs:cseg,ds:cseg
  start:
          jmp     start1
  msgstr  db      'Enter Fahrenheit '
  crlf    db      13,10,'$'
  nine    db      9
  five    db      5
  outstr  db      'Centrigrade is $'
  start1: push    ds
          push    cs
          pop     ds
          mov     dx,offset cseg:msgstr
          mov     ah,9
          int     21h
  sloop:
  cent:   call    getnumb
          test    ax,ax
          je      exit
          push    ax
          mov     dx,offset cseg:outstr
          mov     ah,9
          int     21h
          pop     ax
          sub     ax,32
          jns     c1
          push    ax
          mov     dl,'-'
          mov     ah,6
          int     21h
          pop     ax
          neg     ax
  cl:     mul     five
          div     nine
          call    putval
          mov     dx,offset cseg:crlf
          mov     ah,9
          int     21h
          jmp     sloop
  exit:   pop     ds
          mov     ah,4ch
          int     21h
  getnumb:
          xor     bx,bx
  llp:    mov     dl,0ffh
          mov     ah,1
          int     21h
          cmp     al,0dh
          je      llr
          sub     al,'0'
          jb      llr
          cmp     al,'9'
          ja      llr
          xor     ah,ah
          shl     bx,1
          add     ax,bx
          shl     bx,1
          shl     bx,1
          add     bx,ax
          jmp     llp
  llr:    mov     dx,offset cseg:crlf
          mov     ah,9
          int     21h
          mov     ax,bx
          ret
  putval: xor     bx,bx
          push    bx
          mov     bx,10
  llg:    xor     dx,dx
          div     bx
          add     dx,'0'
          push    dx
          test    ax,ax
          jne     llg
  bloop:  pop     dx
          test    dx,dx
          je      endx
          mov     ah,6
          int     21h
          jmp     bloop
  endx:   ret
  cseg    ends
          end     start