Opcode

From Hidden Wiki
Jump to navigation Jump to search
Unix Assembly language Mathematics Web development I2P
GhostBSD Assembly Programming Tutorial Statistics Django for Beginners MuWire
GUI Artificial intelligence Artificial neural network Machine learning Messenger
Tkinter Artificial intelligence Artificial neural network Machine Learning Mastery with Python Session

In computing, an opcode[1][2] (abbreviated from operation code,[1] also known as instruction machine code,[3] instruction code,[4] instruction syllable,[5][6][7][8] instruction parcel or opstring[9][2]) is the portion of a machine language instruction that specifies the operation to be performed. Beside the opcode itself, most instructions also specify the data they will process, in the form of operands. In addition to opcodes used in the instruction set architectures of various CPUs, which are hardware devices, they can also be used in abstract computing machines as part of their byte code specifications.

Overview

Specifications and format of the opcodes are laid out in the instruction set architecture (ISA) of the processor in question, which may be a general CPU or a more specialized processing unit.[10] Opcodes for a given instruction set can be described through the use of an opcode table detailing all possible opcode bytes. Apart from the opcode itself, an instruction normally also has one or more specifiers for operands (i.e. data) on which the operation should act, although some operations may have implicit operands, or none at all.[10] There are instruction sets with nearly uniform fields for opcode and operand specifiers, as well as others (the x86 architecture for instance) with a more complicated, variable-length structure.[10][11] Instruction sets can be extended through the use of opcode prefixes which add a subset of new instructions made up of existing opcodes following reserved byte sequences.

Operands

Depending on architecture, the operands may be register values, values in the stack, other memory values, I/O ports (which may also be memory mapped), etc., specified and accessed using more or less complex addressing modes.Template:Citation needed The types of operations include arithmetics, data copying, logical operations, and program control, as well as special instructions (such as CPUID and others).[10]

Assembly language, or just assembly, is a low-level programming language, which uses mnemonics, instructions and operands to represent machine code.[10] This enhances the readability while still giving precise control over the machine instructions. Most programming is currently done using high-level programming languages,[12] which are typically easier to read and write.[10] These languages need to be compiled (translated into assembly language) by a system-specific compiler, or run through other compiled programs.[13]

Software instruction sets

Opcodes can also be found in so-called byte codes and other representations intended for a software interpreter rather than a hardware device. These software-based instruction sets often employ slightly higher-level data types and operations than most hardware counterparts, but are nevertheless constructed along similar lines. Examples include the byte code found in Java class files which are then interpreted by the Java Virtual Machine (JVM), the byte code used in GNU Emacs for compiled LISP code, .NET Common Intermediate Language (CIL), and many others.[14]

See also

References

  1. 1.0 1.1 Cite error: Invalid <ref> tag; no text was provided for refs named Barron_1978_Opcode
  2. 2.0 2.1 Cite error: Invalid <ref> tag; no text was provided for refs named Chiba_2007
  3. Cite error: Invalid <ref> tag; no text was provided for refs named Intel_1973_MCS-4
  4. Cite error: Invalid <ref> tag; no text was provided for refs named Intel_1974_MCS-40
  5. Cite error: Invalid <ref> tag; no text was provided for refs named Jones_1988_CISC
  6. Cite error: Invalid <ref> tag; no text was provided for refs named Domagała_2012
  7. Cite error: Invalid <ref> tag; no text was provided for refs named Smotherman_2013
  8. Cite error: Invalid <ref> tag; no text was provided for refs named Jones_2016_CISC
  9. Cite error: Invalid <ref> tag; no text was provided for refs named Schulman_2005
  10. 10.0 10.1 10.2 10.3 10.4 10.5 Cite error: Invalid <ref> tag; no text was provided for refs named Hennessy_2017
  11. Cite error: Invalid <ref> tag; no text was provided for refs named Mansfield_1983
  12. Cite error: Invalid <ref> tag; no text was provided for refs named langpop
  13. Cite error: Invalid <ref> tag; no text was provided for refs named Swanson_2001
  14. Cite error: Invalid <ref> tag; no text was provided for refs named bytecode

Further reading

  • cite book |author-last=Hyde |author-first=Randall |date=2004 |title=Write Great Code: Thinking Low-level, Writing High-level |volume=1 |work=Understanding the Machine |page=passim |location=San Francisco, California, USA |publisher=No Starch Press |isbn=1-59327003-8 | url= https://books.google.com/books?isbn=1593270658 |access-date=2015-10-10