Changes

Jump to: navigation, search

Assembly Language

513 bytes added, 11:02, 10 September 2019
Resources
[[Category:Computer Architecture]][[Category:Assembly Language]]
''Assembly language'' is a [[Symbol|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. Different [[Assembler|assemblers]] use slightly different syntax.
== Examples ==
=== x86 ===
Here is a "Hello, World!" program in x86 assembler for a Linux system, using the [http://www.nasm.us/xdoc/2.11/html/nasmdoc1.html#section-1.1 Nasm ] syntax:
section .text
len equ $ - msg
Here is the same program with [https://sourceware.org/binutils/docs/as/ GNU Assembler (gas/as) ] syntax:
.text
.ascii "Hello, World!\n"
len = . - msg
 
Notice that the order of the arguments in some lines is reversed between the two assemblers, and the prefixes to symbols and values also change.
=== ARM (32-bit) ===
This is written in [https://sourceware.org/binutils/docs/as/ GNU Assembler (gas/as) ] syntax:
.text
len = . - msg
== References Resources ==
* [[Assembler Basics]]
* [http://leto.net/code/asm/hw_assembler.php "Hello World" in many different types of assembler]
* [[x86_64 Register and Instruction Quick Start]]
* [[aarch64 Register and Instruction Quick Start]]

Navigation menu