Log in Sign up
Back to Discover
💻

Executable

technology Maturity 11-13

A computer uses special files.

Binary executable file2.png
Binary executable file2.png
These files tell it what to do. They act like a set of rules. The files help the computer work. It is fun to see them run. Do you like to use computers?

41 words

Computers use special files to work.

Binary executable file2.png
Binary executable file2.png
These files tell the computer how to act. They are like a set of rules for the machine.

People write code to make these files. This code is easy for humans to read. Then, a tool turns it into machine code. This new code tells the computer what to do.

Some files are ready to run right away. Other files need a helper to run them. These files can also hold extra information. This helps the computer start and stop the work well.

92 words

An executable is a special file. It tells a computer how to act.

Binary executable file2.png
Binary executable file2.png

Most people do not write these files by hand. Instead, they write source code. This code is easy for humans to read. Then, they use a tool called a compiler. A compiler turns the code into machine code. Machine code is what the CPU uses to work.

Binary executable file2.png
Binary executable file2.png

Some files are native executables. This means the CPU can run them directly. Other files are called scripts. A script needs a helper called an interpreter to run. There is also bytecode. This is a middle type of code. It can be turned into native code while it runs.

Executable files hold more than just rules. They often have a runtime system. This system helps the program talk to the computer. It helps the program start and stop. It also helps the program manage tasks. Some files use a format called ELF or PE. These formats help organize the parts of the file. They can keep code and data in different sections. This keeps the file neat and ready to use.

187 words

An executable is a special kind of resource. It tells a computer how to behave. Most data is just information for a computer to store. However, an executable is different because it implies a flow of control. This means the computer follows specific instructions in order. People use many names for these files. They might call them executable code or an executable program.

Binary executable file2.png
Binary executable file2.png

How does a computer run these files? It depends on the type of code used. A native executable uses machine code. This code is read directly by the CPU. Other files are called scripts. A script needs an interpreter to work. There is also intermediate code like bytecode. This can be turned into native code while it is running. This process is called just-in-time compilation.

Binary executable file2.png
Binary executable file2.png

People rarely write machine code by hand. It is much easier to write source code. This code is written in a high-level language that humans can read. To turn this into a file, we use a toolchain. A compiler turns source code into object files. Then, a linker joins those files into one executable. If a person uses assembly language, they use an assembler instead.

Binary executable file2.png
Binary executable file2.png

Executable files have very specific rules. They must follow an application binary interface, or ABI. Some files use the ELF format. Others use the PE format. These formats help organize the file into sections. One section is called .text for the code. Another is .data for variables. There is also .rodata for things like strings.

Binary executable file2.png
Binary executable file2.png

An executable file does a lot of work behind the scenes. It often includes a runtime system. This system helps the program talk to the operating system. It manages tasks and handles errors. It also helps the program start and stop correctly. For the C language, a file called crt0 helps with this. It sets up the entry point for the program. This ensures the computer knows exactly where to begin.

Binary executable file2.png
Binary executable file2.png

334 words

An executable is a unique resource used to control a computer's behavior. While all computing information is technically data, executables are distinct. They imply a flow of control, meaning they contain instructions for the computer to follow. People use several different terms to describe this information. You might hear it called executable code, an executable file, an executable program, or an executable image.

Binary executable file2.png
Binary executable file2.png

There are different ways that executable information is processed. A native executable uses machine code. This is code that a CPU can execute directly at the instruction level. Other types of executables work differently. A script is executable, but it works indirectly through an interpreter. There is also intermediate executable code, often called bytecode. This code can be interpreted or converted into native code during runtime. This conversion process is known as just-in-time compilation.

Most software is not written in machine language. It is possible to write native executables directly in machine code, but it is not common. Instead, developers write human-readable source code. They use a toolchain to automate the creation of machine code. Many toolchains use a compiler to turn source code into object files. A linker then joins these object files into a single native executable. If a programmer uses assembly language, they use an assembler instead of a compiler. Assembly language is a type of language that is closely associated with machine code instructions.

Executable files must follow specific organizational rules. They are often stored in a digital container format. One common format is the Executable and Linkable Format, or ELF. Another is the Portable Executable, or PE, which depends on the computing context. These formats allow the machine code to be organized into specific sections. The .text section contains the actual executable code. The .data section holds initialized global and static variables. There is also a .rodata section for read-only data, such as constants and strings.

Beyond the code itself, executable files often include a runtime system. This system manages important features while the program is running. It handles tasks like task scheduling and exception handling. It also manages the calling of static constructors and destructors. The runtime system allows the program to interact with the operating system. It helps pass arguments and environment details to the program. It also handles the exit status when a program finishes. It even manages the release of resources, such as file handles.

In the C programming language, these startup and shutdown tasks are handled in a specific way. This is done by linking in an object called crt0. This object contains the actual entry point for the program. It uses a runtime library to perform the necessary setup and shutdown. However, some systems do not need this much extra code. For example, embedded systems might want to omit the usual runtime. In C, a developer can do this by using a linker script. This script explicitly creates the entry point and handles the startup and shutdown processes. This allows the program to call main and then return an exit status to the kernel.

For any file to be executable, it must conform to an application binary interface, or ABI. The complexity of the interface determines how the file is run. In simple interfaces, the computer loads the file into memory. It then jumps to the start of the address space to begin execution. More complicated interfaces require additional metadata. This metadata might specify relocations that must be performed when the program is loaded. It can also specify the exact entry point address where execution should start.

594 words
🖼️ Images & Media (1)
File:Binary executable file2.png
Binary executable file2.png
Up Next
💻
Machine code
Technology
More to explore

🔬 Go deeper

More advanced topics to explore

🪜 Step back

Simpler topics to build understanding

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.