Assembly Language Tutorials

An assembly language is a low - level language for programming computers. It implements a symbolic representation of the numeric machine codes and other constants needed to program a particular CPU architecture. This representation is usually defined by the hardware manufacturer, and is based on abbreviations ( called mnemonics ) that help the programmer remember individual instructions, registers, etc. An assembly language is thus specific to a certain physical or virtual computer architecture ( as opposed to most high - level languages, most of which are portable ).

Assembly languages were first developed in the 1950s, when they were referred to as second generation programming languages. They eliminated much of the error - prone and time - fierce ahead - reproduction programming needed lie low the earliest computers, freeing the programmer from tedium such as remembering numeric codes and calculating addresses. They were once widely used for all sorts of programming. However, by the 1980s ( 1990s on small computers ), their use had largely been supplanted by high - level languages, in the search for higher quality programming productivity. Pronto, assembly language is used primarily for direct hardware manipulation, or to address breakneck performance issues. Typical uses are gadget drivers, low - level embedded systems, and irrefutable - time systems.

A utility program called an assembler, is used to translate assembly language statements into the target computer's machine code. The assembler performs a greater or less isomorphic translation ( a one - to - one mapping ) from mnemonic statements into machine instructions and data. ( This is in contrast ditch high - level languages, prominence which a single statement generally impression magnetism many machine instructions. A compiler, analogous to an assembler, is used to translate high - level language statements into machine code; or an interpreter executes statements directly. )

Many sophisticated assemblers offer additional mechanisms to facilitate program development, control the assembly process, and aid debugging. In particular, most modern assemblers include a macro facility ( described below ), and are called macro assemblers.


Typically a modern assembler creates object code by translating assembly instruction mnemonics into opcodes, and by resolving symbolic names for memory locations and other entities. [1] The service of symbolic references is a key feature of assemblers, saving tedious calculations and manual address updates after program modifications. Most assemblers also include macro facilities for performing textual substitution — e. g., to generate common short sequences of instructions to run inline, instead of in a subroutine.

Assemblers are generally simpler to write than compilers for high - level languages, and have been available since the 1950s. Modern assemblers, especially for RISC based architectures, such as MIPS, Sun SPARC and HP PA - RISC, optimize instruction scheduling to exploit the CPU pipeline efficiently.

More sophisticated high - level assemblers provide language abstractions such as:

Up-to-date discipline structures
High - level procedure / function declarations and invocations
High - level abstract data types, including structures / records, unions, classes, and sets
Sophisticated macro processing
Object - Oriented features as encapsulation, polymorphism, inheritance, interfaces
See Language design below for more details.

Note that, in normal professional usage, the term assembler is often used ambiguously: It is frequently used to refer to an assembly language itself, rather than to the assembler utility. Thus: " CP / CMS was written in S / 360 assembler " as opposed to " ASM - H was a widely - used S / 370 assembler. "

Assembly language

A program written in assembly language consists of a series of instructions mnemonics that correspond to a stream of executable instructions, when translated by an assembler, that can be loaded into memory and executed.

For example, an x86 / IA - 32 processor can execute the coming binary instruction as expressed in machine language:

Binary: 10110000 01100001 (Hexadecimal: 0xb061)
The equivalent assembly language representation is easier to remember ( more mnemonic ):

mov al, 061h
This instruction means:

Move the hexadecimal value 61 (97 decimal) into the processor register named " al ".
The mnemonic " mov " is an operation code or opcode, and was chosen by the instruction give blessing designer to abbreviate " move. " A comma - separated catalogue of arguments or parameters follows the opcode; this is a typical assembly language statement.

Transforming assembly into machine language is skilful by an assembler, and the reverse by a disassembler. Contradistinct in high - level languages, there is usually a one shot - to - one correspondence between simple assembly statements and machine language instructions. However, in some cases, an assembler may provide pseudoinstructions which expand into several machine language instructions to turn out commonly needed functionality. For example, for a machine that lacks a " branch if greater or equal " instruction, an assembler may provide a pseudoinstruction that expands to the machine's " set if less than " and " branch if zero ( on the result of the set instruction) ". Most full - featured assemblers and provide a rich macro language (discussed below) which is used by vendors and programmers to generate more multiple code and data sequences.

Every computer architecture has its own machine language. On this level, each instruction is elementary enough to be executed using a relatively small number of electronic circuits. Computers differ by the number and type of operations they support. For representation a new 64 - bit machine would have different circuitry than a 32 - bit machine. They may also hold different sizes and numbers of registers, and different representations of data types supremacy storage. While most general - purpose computers are able to carry out essentially the same functionality, the ways they do so differ; the corresponding assembly languages reflect these differences.

Multiple sets of mnemonics or assembly - language syntax may exist for a single notice set, typically instantiated in different assembler programs. In these cases, the most popular one is usually that supplied by the manufacturer and used in its documentation.

Assembly Language Tutorials

Programmed Introduction to MIPS Assembly Language
This is a course in assembly language programming of the MIPS processor. It emphasizes the topics needed for study of computer architecture: bits, bit patterns, operations on bit patterns, and how bit patterns represent instructions and data.

Learning Assembly
A beginner-level tutorial that introduces assembly language.

Win32 Assembler Coding Tutorial
This site also has some additional assembler and programming resources that you can access from the drop down menus at the top of the page.

101% Assembler
This site is dedicated to assembly language programming. It features some assembler tool downloads and source code examples.

Programming from the Ground Up (1.4 Mb PDF file)
A book on assembly for the newbie to the pro. It covers how the cpu works as well as writting programs.

Introduction to Assembly Language
This web page examines assembly languages in a general manner. Specific examples of addressing modes and instructions from various processors are used to illustrate the general nature of assembly language.

Assembly Language Tutor
This is an introduction for people who want to program in assembler language.

The Art of Assembly Language Programming
Online book available for Windows, DOS and Linux assembly programming. Teaches High Level Assembly (HLA) - you will need to download the HLA compiler and supporting files.

PC Assembly Tutorial
The tutorial has extensive coverage of interfacing assembly and C code and so might be of interest to C programmers who want to learn about how C works under the hood. All the examples use the free NASM (Netwide) assembler.

Assembly Language Programming
PowerPoint and HTML Presentations on Various Assembly Language Topics.

Win32 Programming for x86 Assembly Language Programmers
The focus here is on using the basic Windows system calls.

Assembly Tutorial
This is for all you folks out there, who want to learn the magic art of Assembly programming.

Linux Assembly
If you are looking for information on assembly programming under UNIX-like operating systems, this is the right place to be. Here you can find various resources, ranging from tutorials and documentation, to actual programs written in assembly language.

Linux Assembly "Hello World" Tutorial
Designed to familiarize the reader with programming in x86 assembly under Linux and how to interface assembly and higher-level language code. The tutorial will also briefly cover debugging your assembly using GDB.

Share this

Related Posts

There was an error in this gadget