Opcode: Difference between revisions

Content deleted Content added
m Reverting possible vandalism by 164.215.201.206 to version by KH-1. Report False Positive? Thanks, ClueBot NG. (4133760) (Bot)
mNo edit summary
Line 7:
==Overview==
Specifications and format of the opcodes are laid out in the instruction set architecture ([[instruction set architecture|ISA]]) of the processor in question, which may be a general [[central processing unit|CPU]] or a more specialized processing unit.<ref name="Hennessy_2017"/> Opcodes for a given instruction set can be described through the use of an [[opcode table]] detailing all possible opcodes. Apart from the opcode itself, an instruction normally also has one or more specifiers for [[operand]]s (i.e. data) on which the operation should act, although some operations may have ''implicit'' operands, or none at all.<ref name="Hennessy_2017"/> 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.<ref name="Hennessy_2017"/><ref name="Mansfield_1983"/> Instruction sets can be extended through the use of [[opcode prefix]]es which add a subset of new instructions made up of existing opcodes following reserved byte sequences.
 
===Operands===
Depending on architecture, the ''operands'' may be [[processor register|register]] values, values in the [[call stack|stack]], other [[memory]] values, [[I/O]] ports (which may also be [[Memory-mapped I/O|memory mapped]]), etc., specified and accessed using more or less complex [[addressing mode]]s.{{citation needed|date=October 2015}} The types of ''operations'' include [[arithmetic]], data copying, [[logical operation]]s, and program control, as well as special instructions (such as [[CPUID]] and others).<ref name="Hennessy_2017"/>
Line 13 ⟶ 14:
 
=={{Anchor|SIS}}Software instruction sets==
Opcodes can also be found in so-called [[byte code]]s 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 file]]s which are then interpreted by the [[Java virtual machine|Java Virtual Machine]] (JVM), the byte code used in [[GNU Emacs]] for compiled [[Lisp (programming language)|Lisp]] code, .NET [[Common Intermediate Language]] (CIL), and many others.<ref name="bytecode"/>
 
== See also ==
{{Portal|Computer programming}}
* [[Gadget (machine instruction sequence)]]
Line 22 ⟶ 23:
* [[Syllable (computing)]]
 
== References ==
{{Reflist|40em|refs=
<ref name="Barron_1978_Opcode">{{cite book |author-first=David William |author-last=Barron |author-link=David W. Barron |editor-first=J. John |editor-last=Floretin |title=Assemblers and Loaders |date=1978 |orig-year=1971, 1969 |edition=3 |publisher=[[Elsevier North-Holland Inc.]] |series=Computer Monographs |publication-place=New York, USA |___location=[[University of Southampton]], Southampton, UK |isbn=0-444-19462-2 |lccn=78-19961 |chapter=2.1. Symbolic instructions |page=7}} (xii+100 pages)</ref>