What is "assembly"
Assembly is a family of very low-level programming languages, just above the machine code. In assembly, each instruction corresponds to a single machine code instruction. These instructions are converted into machine code executable by a utility program referred to as a assembler (or Assembler), the conversion process is referred to as Assembly, or code assembly.
Language design
Basics
There is a great deal of diversity in the way that assemblers categorize statements and in the nomenclature that they use. In particular, some describe a mnemonic machine or extended mnemonic as a pseudo-operation (pseudo-op). Typical assembly language consists of three types of statement statements that are used to define program operations:
- Mnemonics opcode
- Data sections
- Directives of the Assembly
Mnemonics Opcode and extended mnemonics
Instructions (statements) in Assembly language are usually very simple, unlike those in high-level language. Generally, a mnemonic is a symbolic name for a single instruction in executable machine language (an operation code), and there is at least one mnemonic optode defined for each machine language instruction. Each instruction typically consists of an operation code operation and zero or more operandos. Most instructions refer to a single value, or a pair of values. Operands can be immediate (value encoded in the instruction itself), records specified in the instruction or implicit, or addresses of data located elsewhere in the storage. This is determined by the underlying processor architecture: the assembler only reflects how this architecture works. Extended mnemonics are often used to specify a combination of an operation code with a specific operand. For example, System/360 assemblers use B
as a mnemonic extended to BC
with a mask of 15 and NOP
for BC
with a mask of 0.
Extended mnemonics are often used to support specialized uses of instructions, often for purposes not obvious by the name of the instruction. For example, many CPU does not have an instruction NOP
explicit, but has instructions that can be used for the same purpose. In Cpus 8086 the instruction xchg ax,ax
is used for nop
, with nop
being a pseudo operation code for encoding the instruction xchg ax,ax
. Some disassemblers recognize this and decodes, the instruction xchg ax,ax
as nop
. Similarly, IBM assemblers for System/360 and System/370 use extended mnemonics NOP
and NOPR
for BC
and BCR
with zero masks. For SPARC architecture, these are known as synthetic instructions.
Some assemblers also support simple macro-instructions that generate two or more machine instructions. For example, with some Z80 assemblers the instruction ld hl, bc
is recognized to generate ld l, c
followed by ld h, b
. These are known as pseudo-opcodes.
Tag use
Use the tag Assembly for Assembly language programming questions, on any processor. You should also use a tag for your processor or set d architecture constructs (Arm, avr, mips, x86, x86-64, etc.) Consider a tag for your Assembler as well as (gas, masm, nasm, etc.).
If your question is about embedded Assembly in C or other programming languages, see inline-Assembly. For questions about Assembly files. Net, use .net-Assembly.
Resources
Beginner’s Resources
- Professional Assembly Language - Richard Blum
- Assembly Language Step-by-Step: Programming with Linux - Jeff Duntemann
- The Art of Assembly Language Programming (e-book)
- Assembly primer - Write your Own OS
- Introduction to Assembly Language - Dandamudi
Free Assembly Language Books