Assembly Language: Difference between revisions

From Citizendium
Jump to navigation Jump to search
imported>Markus Baumeister
m (and now including "workgroup")
mNo edit summary
 
(6 intermediate revisions by 6 users not shown)
Line 1: Line 1:
Assembly Language is a method of abstracting machine code instructions for a computer into commands recognizable by a human.  Instead of dealing directly with bit sequences, programmers write programs in assembly by generating blocks of code using a small set of keywords (which are mapped to machine instructions by an assembler).
{{subpages}}


An example [[Hello World]] program written in pseudo-assembly is listed below.  Original source: [http://www2.latech.edu/~acm/helloworld/asm.html Assembly Language for the IBM-PC].
'''Assembly language''' is a method of abstracting [[machine code]] instructions for a [[computer]] into commands recognizable by a human.  Instead of dealing directly with bit sequences, programmers write programs in assembly by generating blocks of code using a small set of keywords (which are mapped to machine instructions by an [[assembler]]).


-----
Assemblers not only relieve the programmer of remembering instruction codes, but allow symbolic reference to memory locations, further improving redability.
.data
hello_message db 'Hello, World!',0dh,0ah,'$'


.code
An example [[Hello World]] program written in pseudo-assembly for a [[MS-DOS]]-based system is listed below.  Original source: [http://www2.latech.edu/~acm/helloworld/asm.html Assembly Language for the IBM-PC].
main proc
  mov ax,@data
  mov ds,ax


   mov ah,9
-----
  mov dx,offset hello_message
  .data
  int 21h
    hello_message db 'Hello, World!',0dh,0ah,'$'
 
 
  mov ax,4C00h
  .code
  int 21h
  main proc
main endp
    mov ax,@data
end main
    mov ds,ax
    
    mov ah,9
    mov dx,offset hello_message
    int 21h
 
    mov ax,4C00h
    int 21h
  main endp
  end main
-----
-----


Assembly programs are much easier to understand than their corresponding machine code instruction streams, but they are much more difficult to comprehend than, say, the [[PHP Hello World]] program.
Assembly programs are much easier to understand than their corresponding machine code instruction streams, which are just numbers, but they are much more difficult to comprehend than most general-purpose higher-level [[programming languages]], such as the [[C programming language]] or [[Java]]. There are, however, higher-level programming languages such as [[APL]] that are unreadable by other than a specialist.[[Category:Suggestion Bot Tag]]
 
[[Category: CZ Live]]
[[Category: Computers Workgroup]]

Latest revision as of 17:00, 13 July 2024

This article is a stub and thus not approved.
Main Article
Discussion
Related Articles  [?]
Bibliography  [?]
External Links  [?]
Citable Version  [?]
 
This editable Main Article is under development and subject to a disclaimer.

Assembly language is a method of abstracting machine code instructions for a computer into commands recognizable by a human. Instead of dealing directly with bit sequences, programmers write programs in assembly by generating blocks of code using a small set of keywords (which are mapped to machine instructions by an assembler).

Assemblers not only relieve the programmer of remembering instruction codes, but allow symbolic reference to memory locations, further improving redability.

An example Hello World program written in pseudo-assembly for a MS-DOS-based system is listed below. Original source: Assembly Language for the IBM-PC.


 .data
   hello_message db 'Hello, World!',0dh,0ah,'$'
 
 .code
 main proc
   mov ax,@data
   mov ds,ax
 
   mov ah,9
   mov dx,offset hello_message
   int 21h
 
   mov ax,4C00h
   int 21h
 main endp
 end main

Assembly programs are much easier to understand than their corresponding machine code instruction streams, which are just numbers, but they are much more difficult to comprehend than most general-purpose higher-level programming languages, such as the C programming language or Java. There are, however, higher-level programming languages such as APL that are unreadable by other than a specialist.