Opcode: Difference between revisions

Content deleted Content added
m Corrected link to disambiguation page. (you can help!)
Line 1:
In [[computer science]], an '''Opcode''' is the portion of a [[machine language]] [[instruction (computer science)|instruction]] that specifies the operation to be performed. The term is an abbreviation of '''Op'''eration '''Code'''. Their specification and format will be laid out in the [[instruction set architecture]] (ISA) of the [[computer hardware]] component in question—normally a [[central processing unit|CPU]], but possibly a more specialised unit. A complete machine language instruction contains an opcode and, optionally, the specification of one or more [[operand]]s—what data the operation should act upon. Some operations have ''implicit'' operands, or indeed none. Some ISAs have instructions with defined fields for opcodes and operands, while others (e.g. the [[Intel x86]] architecture) have a more complicated and ad-hoc structure.
 
The operands upon which opcodes operate may, depending on CPU architecture, consist of [[processor register|registers]], values in [[memory]], values stored on the [[Stackcall (computing)stack|stack]], [[I/O]] ports, the [[Computer bus|bus]], etc. The operations an opcode may specify can include arithmetic, data copying, logical operations, and program control.
 
Opcodes can also be found in [[byte code]]s interpreted by a byte code interpreter (or [[virtual machine]], in one sense of that term). In these, an instruction set architecture is created to be interpreted by software, rather than a hardware device. Often, byte code interpreters work with higher-level data types and operations than a hardware instruction set, but are constructed along similar lines. Examples include the [[Java programming language]]'s [[Java Virtual Machine]] (JVM), the byte code used in [[GNU Emacs]] for compiled [[LISP]] code, and many others.