Log in Sign up
Back to Discover
💻

Assembly language

technology Maturity 11-13

Computers use special codes. These codes tell them what to do. A program helps turn the code into work. This helps computers run fast. It is a smart way to work. Do you like computers?

35 words

{ "text": "Computers use codes to do work. These codes are hard to read. People use a special way to write them. This way uses simple words instead. It is called assembly language. \n\nA helper program turns these words into codes. This helper is called an assembler. It works like a translator. It turns the words into numbers. The computer can then read them. [IMAGE:

65 words

Computers follow instructions to do work. These instructions are often just numbers. This is called machine code. It is hard for people to read. To help, people use assembly language.

Assembly language uses short words called mnemonics. These words stand for the machine code. For example, a word might mean "add." This makes the code easier to read. It also helps people avoid making mistakes.

A helper program is needed. We call this program an assembler. The assembler turns the words into machine code. This is a set of steps called assembly.

Each assembly language is special. It is made for one type of computer. For example, some work for x86 chips. Others work for ARM chips.

In the past, people used assembly for almost everything. Now, most people use high-level languages. These are easier and faster to use. But assembly is still very useful. It lets people talk directly to the computer hardware. Some big systems still use a little bit of it. For example, a tiny part of the Linux kernel uses assembly.

175 words

Computers follow instructions to do work. These instructions are often just numbers. This is called machine code. It is hard for people to read. To help, people use assembly language.

Assembly language uses short words called mnemonics. These words stand for the machine code. For example, a word might mean "add." This makes the code easier to read. It also helps people avoid making mistakes.

A helper program is needed. We call this program an assembler. The assembler turns the words into machine code. This is a set of steps called assembly.

Each assembly language is special. It is made for one type of computer. For example, some work for x86 chips. Others work for ARM chips.

In the past, people used assembly for almost everything. Now, most people use high-level languages. These are easier and faster to use. But assembly is still very useful. It lets people talk directly to the computer hardware. Some big systems still use a little bit of it. For example, a tiny part of the Linux kernel uses assembly.

180 words

Assembly language is a low-level programming language used to communicate with computers. It has a very strong correspondence to the machine code instructions of a computer's architecture. This means there is usually a one-to-one relationship between an assembly statement and a machine code instruction. While machine code consists of raw numbers, assembly uses symbolic representations. This makes it much easier for humans to read and write. It provides a way to interact directly with the hardware of a processor. Because it is so close to the hardware, it is essential for specific computing tasks.

To turn these human-readable words into something a computer can run, we use a utility program called an assembler. The process of converting source code into executable machine code is called assembly. During this process, the assembler performs several important tasks. It translates mnemonics, which are short symbolic names, into their numerical equivalents. These numerical values include an operation code, or opcode, and other control bits. The assembler also calculates constant expressions and resolves symbolic names for memory locations. By using these symbols, programmers avoid the tedious work of manual address updates. This makes the code much more readable than raw machine code.

Assembly language is not universal. Each language is specific to a particular computer architecture, such as x86 or ARM. Because the language depends on the machine code instructions, it must match the processor. There can be multiple assemblers for a single architecture. Some assemblers might even be specific to a particular operating system. However, most assembly languages can be used with any operating system. This is because the language provides access to the real capabilities of the processor. All system call mechanisms ultimately rest upon these hardware capabilities.

There are different types of assemblers designed for different needs. A macro assembler includes a facility to represent assembly text with a single name. This name can then be used to insert expanded text into other code. A cross assembler is run on a host system that is different from the target system. This is very helpful for developing programs for small devices like microcontrollers. These devices often lack the resources to support full software development tools. A high-level assembler provides more complex abstractions. These include structures, records, and advanced control structures like IF/THEN/ELSE. There are even meta-assemblers, which are programs that can generate an assembler for a specific language.

History shows how much programming has changed over time. The first assembly code appeared in 1947 in the work "Coding for A.R.C." by Kathleen and Andrew Donald Booth. The term "assembler" is often attributed to Wilkes, Wheeler, and Gill in their 1951 book. In the early decades of computing, programmers used assembly for almost all tasks. This included both system programming and application programming. Today, most programming is done in high-level languages. Fred Brooks noted that moving to high-level languages increased productivity by a factor of five. These languages are more portable and easier to understand than assembly.

Despite the rise of high-level languages, assembly remains vital for performance. It is often used in small amounts within larger systems to interact with hardware. For example, in version 4.9 of the Linux kernel, more than 97% is written in C. However, just under 2% is written in assembly language. This small portion allows the kernel to handle tasks that high-level languages cannot. Some assemblers can even perform optimizations. For instance, x86 assemblers can perform jump-sizing to replace long jumps with shorter ones. This helps the computer execute instructions more efficiently.

Assemblers can also function using different methods to read code. One-pass assemblers process the source code only once. If a symbol is used before it is defined, the assembler notes it for later patching. Multi-pass assemblers are more thorough. They use the first pass to create a table of all symbols and their values. They then use later passes to generate the final code. This method avoids errors and makes the final linking process faster. In the past, one-pass assemblers were used to save memory and time. Modern computers have much larger memories, making multi-pass processing much easier.

682 words
Up Next
💻
Low-level programming language
Technology
More to explore

What is Nepedia?

A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.