Open main menu

CDOT Wiki β

Changes

Assembly Language

953 bytes added, 10:36, 7 January 2014
Created page with 'Category:Computer Architecture ''Assembly language'' is a symbolic representation of machine language. It is therefore [[Portable|architecture-specif…'
[[Category:Computer Architecture]]
''Assembly language'' is a [[symbolic]] representation of [[Machine Language|machine language]]. It is therefore [[Portable|architecture-specific]].

Each instruction is represented by a short mnemonic word such as "LDR" for ''Load Register'', "MOV" for ''move'', or "MUL" for ''multiply'', followed by (optional) arguments. The [[Addressing Mode|addressing mode]] is implied by the format of the arguments.

== Examples ==

=== x86 ==

Here is a "Hello, World!" program in x86 assembler for a Linux system:

section .text
global _start

_start:
mov edx,len ; message length
mov ecx,msg ; message location
mov ebx,1 ; file descriptor stdout
mov eax,4 ; syscall sys_write
int 0x80

mov eax,1 ; syscall sys_exit
int 0x80

section .rodata

msg db 'Hello, world!',0xa
len equ $ - msg