Katana VentraIP

Computer program

A computer program is a sequence or set[a] of instructions in a programming language for a computer to execute. It is one component of software, which also includes documentation and other intangible components.[1]

For the TV program, see The Computer Programme.

A computer program in its human-readable form is called source code. Source code needs another computer program to execute because computers can only execute their native machine instructions. Therefore, source code may be translated to machine instructions using a compiler written for the language. (Assembly language programs are translated using an assembler.) The resulting file is called an executable. Alternatively, source code may execute within an interpreter written for the language.[2]


If the executable is requested for execution, then the operating system loads it into memory and starts a process.[3] The central processing unit will soon switch to this process so it can fetch, decode, and then execute each machine instruction.[4]


If the source code is requested for execution, then the operating system loads the corresponding interpreter into memory and starts a process. The interpreter then loads the source code into memory to translate and execute each statement. Running the source code is slower than running an executable.[5][b] Moreover, the interpreter must be installed on the computer.

Memory instructions to set and access numbers and in random-access memory.

strings

Integer (ALU) instructions to perform the primary arithmetic operations on integers.

arithmetic logic unit

Floating point ALU instructions to perform the primary arithmetic operations on .

real numbers

instructions to push and pop words needed to allocate memory and interface with functions.

Call stack

(SIMD) instructions[d] to increase speed when multiple processors are available to perform the same algorithm on an array of data.

Single instruction, multiple data

express ideas directly in the code.

express independent ideas independently.

express relationships among ideas directly in the code.

combine ideas freely.

combine ideas only where combinations make sense.

express simple ideas simply.

The function of a module is what it does.

The context of a module are the elements being performed upon.

The logic of a module is how it performs the function.

The kernel program should perform ,[132] which is also known as a context switch. The kernel creates a process control block when a program is selected for execution. However, an executing program gets exclusive access to the central processing unit only for a time slice. To provide each user with the appearance of continuous access, the kernel quickly preempts each process control block to execute another one. The goal for system developers is to minimize dispatch latency.

process scheduling