Program structure

Programming languages - Instructions

API
Linguaggi informatici - Istruzioni Linguagens informáticas - Instruções Programmiersprachen - Instruktionen Langages informatiques - Instructions Lenguajes de programación - Instrucciones

What does an instruction look like?

The instruction is the key element in the computer as it tells the processor which action should be performed. The instructions which are to be executed are indicated in the source file and the computer goes from one instruction to the next following the instructions from top to bottom (as a file is read in sequence from top to bottom).
An instruction is generally comprised of two elements:

  • the operator: the action that the processor is to carry out
  • the operand(s): one or more pieces of data on which the operation is performed

operator operand(s)

Types of operators:

There are generally two or three types of operators:

  • Unary operators: those which operate on one operand only
  • Binary operators: these operators are those which, contrary to what you would think, do not work on binary operands, but rather work on two operands (binary here means the number of operands that are affected, addition, often denoted as +, is therefore a binary operator)
  • Ternary operators: are operators which allow three operands (for example, conditional operators are ternary operators)
Operators may also be divided into several categories according to the type of operation they perform when executed:
  • arithmetic operators
  • comparison operators
  • logical operators
  • bit operators
  • assignment operators
  • conditional operators
  • sequential operators
  • ...

Operator priority

Each language generally has operator precedence so that the computer knows in which direction to calculate the operators where several operators exist in the same expression

Last update on Thursday October 16, 2008 02:43:20 PM.This document entitled « Programming languages - Instructions » from Kioskea (en.kioskea.net) is made available under the Creative Commons license. You can copy, modify copies of this page, under the conditions stipulated by the licence, as this note appears clearly.

Best answers for « Programming languages Instructions » in :
Programming languages Show Programming language A "programming language" is a language designed to describe a set of consecutive actions to be executed by a computer. A programming language is therefore a practical way for us (humans) to give instructions to a...
Characteristics of programming languages Show There are many programming languages, each corresponding to specific needs (formula calculus, character string processing, real-time, etc.) with each having specific characteristics and functionalities. Therefore, the choice of programming language...
Programming languages - API Show API An API (Application Programming Interface) is a set of functions allowing the programmer to access an application's services through the use of a programming language. An API provides the developer with an abstraction layer, which masks the...
[Myth] Informatic language = Programming language ShowInformatic language equals Programming language Myth Reality Explanations Note Myth All languages are programming languages. Reality FALSE Explanations There are several types of languages. Most of them are programming languages...
[Pascal language] Recursion within a Bubble Sort Show[Pascal language] Recursion within a Bubble Sort Pascal is a stable, efficient and block-structured programming language. The "type" of variables used in Pascal language is made up of its semantic nature and its range of values, and can...
[Myths]The Python language is weakly typed Show[Myth] The Python language is weakly typed Myth Reality Demonstration Myth The programming language Python is weakly typed, like PHP or Basic. Reality FALSE. Explanations Python is a language with dynamic typing. Python...
Programming languages - Instructions ShowFramework The term "Application Framework" describes an API structured set, which is organised within an executable environment. The term "Application Framework" is generally shortened to just "Framework".
Program structure ShowHow does a computer program work? A program's behaviour depends on the type of language used to write the program. Nonetheless, almost all programming languages are based upon the same principle: The program consists of a set of commands that the...
Computer program ShowWhat is a computer program? A computer program is a series of commands that are executed by the computer. However, the computer is only capable of processing binary, i.e. a series of 0s and 1s. Therefore we require a programming language to be...