Information about Machine Code
Machine code or machine language is a system of instructions and data directly executed by a computer's central processing unit. Machine code is the lowest-level of abstraction for representing a computer program.
Every CPU model has its own machine code, or instruction set. Successor or derivative processor designs may completely include all the instructions of a predecessor and may add additional instructions. Some nearly completely compatible processor designs may have slightly different effects after similar instructions. Occasionally a successor processor design will discontinue or alter the meaning of a predecessor's instruction code, making migration of machine code between the two processors more difficult. Even if the same model of processor is used, two different systems may not run the same example of machine code if they differ in memory arrangement, operating system, or peripheral devices; the machine code has no embedded information about the configuration of the system.
A machine code instruction set may have all instructions of the same length, or may have variable-length instructions. How the patterns are organized depends largely on the specification of the machine code. Common to most is the division of one field (the opcode) which specifies the exact operation (for example "add"). Other fields may give the type of the operands, their location, or their value directly (operands contained in an instruction are called immediate). Some exotic instruction sets do not have an opcode field (such as Transport Triggered Architectures or the Forth virtual machine), only operand(s). Other instruction sets lack any operand fields, such as NOSCs[1].
Program flow may be influenced by special 'jump' instructions that transfer execution to an instruction other than the following one. Conditional jumps are taken (execution continues at another address) or not (execution continues at the next instruction) depending on some condition.
6 5 5 5 5 6 bits [ op | rs | rt | rd |shamt| funct] R-type [ op | rs | rt | address/immediate] I-type [ op | target address ] J-type
rs, rt, and rd indicate register operands; shamt gives a shift amount; and the address or immediate fields contain an operand directly.
For example adding the registers 1 and 2 and placing the result in register 6 is encoded:
[ op | rs | rt | rd |shamt| funct] 0 1 2 6 0 32 decimal 000000 00001 00010 00110 00000 100000 binary
Load a value into register 8, taken from the memory cell 68 cells after the location listed in register 3:
[ op | rs | rt | address/immediate] 35 3 8 68 decimal 100011 00011 01000 00000 00001 000100 binary
Jumping to the address 1025:
[ op | target address ] 2 1025 decimal 000010 00000 00000 00000 10000 000001 binary
Using a microcode layer to implement an emulator enables the computer to present the architecture of an entirely different computer. The System/360 line used this to allow porting programs from earlier IBM machines to the new family of computers, e.g. an IBM 1401/1440/1460 emulator on the IBM S/360 model 40.
..... Click the link for more information.
John LeRoy Hennessy, the founder of MIPS Computer Systems Inc., is currently serving as the 10th President of Stanford University.
..... Click the link for more information.
..... Click the link for more information.
Machine code instructions
Instructions are patterns of bits with different patterns corresponding to different commands to the machine.Every CPU model has its own machine code, or instruction set. Successor or derivative processor designs may completely include all the instructions of a predecessor and may add additional instructions. Some nearly completely compatible processor designs may have slightly different effects after similar instructions. Occasionally a successor processor design will discontinue or alter the meaning of a predecessor's instruction code, making migration of machine code between the two processors more difficult. Even if the same model of processor is used, two different systems may not run the same example of machine code if they differ in memory arrangement, operating system, or peripheral devices; the machine code has no embedded information about the configuration of the system.
A machine code instruction set may have all instructions of the same length, or may have variable-length instructions. How the patterns are organized depends largely on the specification of the machine code. Common to most is the division of one field (the opcode) which specifies the exact operation (for example "add"). Other fields may give the type of the operands, their location, or their value directly (operands contained in an instruction are called immediate). Some exotic instruction sets do not have an opcode field (such as Transport Triggered Architectures or the Forth virtual machine), only operand(s). Other instruction sets lack any operand fields, such as NOSCs[1].
Programs
A program is a sequence of instructions that are executed by a CPU. While simple processors execute instructions one after the other, superscalar processors are capable of executing several instructions at once.Program flow may be influenced by special 'jump' instructions that transfer execution to an instruction other than the following one. Conditional jumps are taken (execution continues at another address) or not (execution continues at the next instruction) depending on some condition.
Assembly languages
00000101, which causes the CPU to decrement the B processor register, would be represented in assembly language as DEC B.
Example
The MIPS architecture provides a specific example for a machine code whose instructions are always 32 bits long. The general type of instruction is given by the op (operation) field, the highest 6 bits. J-type (jump) and I-type (immediate) instructions are fully specified by op. R-type (register) instructions include an additional field funct to determine the exact operation. The fields used in these types are:6 5 5 5 5 6 bits [ op | rs | rt | rd |shamt| funct] R-type [ op | rs | rt | address/immediate] I-type [ op | target address ] J-type
rs, rt, and rd indicate register operands; shamt gives a shift amount; and the address or immediate fields contain an operand directly.
For example adding the registers 1 and 2 and placing the result in register 6 is encoded:
[ op | rs | rt | rd |shamt| funct] 0 1 2 6 0 32 decimal 000000 00001 00010 00110 00000 100000 binary
Load a value into register 8, taken from the memory cell 68 cells after the location listed in register 3:
[ op | rs | rt | address/immediate] 35 3 8 68 decimal 100011 00011 01000 00000 00001 000100 binary
Jumping to the address 1025:
[ op | target address ] 2 1025 decimal 000010 00000 00000 00000 10000 000001 binary
Relationship to microcode
In some computer architectures, the machine code is implemented by a more fundamental underlying layer of programs called microprograms, providing a common machine language interface across a line or family of different models of computer with widely different underlying dataflows. This is done to facilitate porting of machine language programs between different models. An example of this use is the IBM System/360 family of computers and their successors. With dataflow path widths of 8 bits to 64 bits and beyond, they nevertheless present a common architecture at the machine language level across the entire line.Using a microcode layer to implement an emulator enables the computer to present the architecture of an entirely different computer. The System/360 line used this to allow porting programs from earlier IBM machines to the new family of computers, e.g. an IBM 1401/1440/1460 emulator on the IBM S/360 model 40.
See also
- Reduced Instruction Set Computer (RISC)
- VLIW
- Endianness
- Teaching Machine Code: Microprofessor I
Further reading
- Hennessy, John L.; Patterson, David A.. Computer Organization and Design. The Hardware/Software Interface.. Morgan Kaufmann Publishers. ISBN 1-55860-281-X.
- Tanenbaum, Andrew S.. Structured Computer Organization. Prentice Hall. ISBN 0-13-020435-8.
Types of Programming languages |
|---|
| Array Assembly Compiled Concurrent Curly bracket Data-structured Declarative Esoteric Data-oriented Extension Functional Interpreted Logic Machine Macro Metaprogramming Multi-paradigm Non-English-based Object-oriented Prototype-based Off-side rule Procedural Reflective Rule-based Synchronous Scripting Domain-specific Visual Dataflow Imperative |
computer is a machine which manipulates data according to a list of instructions.
Computers take numerous physical forms. The first devices that resemble modern computers date to the mid-20th century (around 1940 - 1941), although the computer concept and various machines
..... Click the link for more information.
Computers take numerous physical forms. The first devices that resemble modern computers date to the mid-20th century (around 1940 - 1941), although the computer concept and various machines
..... Click the link for more information.
central processing unit (CPU), or sometimes simply processor, is the component in a digital computer capable of executing a program.(Knott 1974) It interprets computer program instructions and processes data.
..... Click the link for more information.
..... Click the link for more information.
BIT is an acronym for:
..... Click the link for more information.
- Bannari amman Institute of Technology
- Bangalore Institute of Technology
- Beijing Institute of Technology
- Benzisothiazolinone
- Bilateral Investment Treaty
- Bhilai Institute of Technology - Durg
..... Click the link for more information.
instruction set is (a list of) all instructions, and all their variations, that a processor can execute.
Instructions include:
..... Click the link for more information.
Instructions include:
- arithmetic such as add and subtract
- logic instructions such as and, or, and not
..... Click the link for more information.
In computer science, an opcode (Operation Code) is the portion of a machine language instruction that specifies the operation to be performed. Their specification and format will be laid out in the instruction set architecture (ISA) of the computer hardware component
..... Click the link for more information.
..... Click the link for more information.
In mathematics, an operand is one of the inputs (arguments) of an operator. For instance, in
'+' is the operator and '3' and '6' are the operands.
The number of operands of an operator is called its arity.
..... Click the link for more information.
- 3 + 6 = 9
'+' is the operator and '3' and '6' are the operands.
The number of operands of an operator is called its arity.
..... Click the link for more information.
Addressing modes, a concept from computer science, are an aspect of the instruction set architecture in most central processing unit (CPU) designs. The various addressing modes that are defined in a given instruction set architecture define how machine language instructions in that
..... Click the link for more information.
..... Click the link for more information.
Transport triggered architecture (TTA) is an application-specific instruction set processor (ASIP) architecture template that allows easy customization of microprocessor designs.
..... Click the link for more information.
..... Click the link for more information.
threaded code refers to a compiler implementation technique where the generated code has a form that essentially consists entirely of calls to subroutines. The code may be processed by an interpreter, or may simply be a sequence of machine code call instructions.
..... Click the link for more information.
..... Click the link for more information.
superscalar CPU architecture implements a form of parallelism called Instruction-level parallelism within a single processor. It thereby allows faster CPU throughput than would otherwise be possible at the same clock rate.
..... Click the link for more information.
..... Click the link for more information.
Not to be confused with flow control.
In computer science control flow (or alternatively, flow of control) refers to the order in which the individual statements, instructions or function calls of an imperative or functional program are executed or..... Click the link for more information.
An instruction is a form of communicated information that is both command and explanation'' for how an action, behavior, method, or task is to be begun, completed, conducted, or executed.
..... Click the link for more information.
..... Click the link for more information.
A branch (or jump on some computer architectures, such as the PDP-8 and Intel x86) is a point in a computer program where the flow of control is altered. The term branch is usually used when referring to a program written in machine code or assembly language; in a high-level
..... Click the link for more information.
..... Click the link for more information.
assembly language is a low-level language for programming computers. It implements a symbolic representation of the numeric machine codes and other constants needed to program a particular CPU architecture.
..... Click the link for more information.
..... Click the link for more information.
assembly language is a low-level language for programming computers. It implements a symbolic representation of the numeric machine codes and other constants needed to program a particular CPU architecture.
..... Click the link for more information.
..... Click the link for more information.
The Zilog Z80 is an 8-bit microprocessor designed and sold by Zilog from July 1976 onwards. It was widely used both in desktop and embedded computer designs as well as for military purposes.
..... Click the link for more information.
..... Click the link for more information.
In computer architecture, a processor register is a small amount of storage available on the CPU whose contents can be accessed more quickly than storage available elsewhere.
..... Click the link for more information.
..... Click the link for more information.
MIPS (originally an acronym for Microprocessor without Interlocked Pipeline Stages) is a RISC microprocessor architecture developed by MIPS Technologies. By the late 1990s it was estimated that one in three RISC chips produced were MIPS-based designs.
..... Click the link for more information.
..... Click the link for more information.
computer architecture is the conceptual design and fundamental operational structure of a computer system. It is a blueprint and functional description of requirements (especially speeds and interconnections) and design implementations for the various parts of a computer —
..... Click the link for more information.
..... Click the link for more information.
A microprogram implements a CPU instruction set. Just as a single high level language statement is compiled to a series of machine instructions (load, store, shift, etc), in a CPU using microcode, each machine instruction is in turn implemented by a series of microinstructions,
..... Click the link for more information.
..... Click the link for more information.
Dataflow is a term used in computing, and may have various shades of meaning. It is closely related to message passing.
..... Click the link for more information.
Software architecture
Dataflow is a software architecture based on the idea that changing the value of a variable should automatically force..... Click the link for more information.
porting is the process of adapting software so that an executable program can be created for a computing environment that is different from the one for which it was originally designed (e.g. different CPU, operating system, or third party library).
..... Click the link for more information.
..... Click the link for more information.
System/360 Model 65 operator's console, with register value lamps and toggle switches (middle of picture) and "emergency pull" switch (upper right).]] The IBM System/360 (S/360) is a mainframe computer system family announced by IBM on April 7, 1964.
..... Click the link for more information.
..... Click the link for more information.
emulator duplicates (provides an emulation of) the functions of one system with a different system, so that the second system behaves like (and appears to be) the first system.
..... Click the link for more information.
..... Click the link for more information.
The IBM 1400 series were second generation (transistorized) mid-range business computers that IBM sold in the early 1960s. They could be operated as an independent systems, in conjunction with IBM punched card equipment, or as auxiliary equipment to other computer systems.
..... Click the link for more information.
..... Click the link for more information.
reduced instruction set computer (RISC, pronounced like "risk") is a CPU design philosophy that favors an instruction set reduced both in size and complexity of addressing modes, in order to enable easier implementation, greater instruction level parallelism, and
..... Click the link for more information.
..... Click the link for more information.
In computing, endianness is the byte (and sometimes bit) ordering in memory used to represent some kind of data. Typical cases are the order in which integer values are stored as bytes in computer memory (relative to a given memory addressing scheme) and the transmission order over
..... Click the link for more information.
..... Click the link for more information.
Microprofessor I (MPF 1), introduced in 1981 by Multitech, who changed their company name to Acer in 1987, was their first branded computer product and probably one of the world's longest selling computers.
..... Click the link for more information.
..... Click the link for more information.
- For other people named John Hennessy, see John Hennessy.
John LeRoy Hennessy, the founder of MIPS Computer Systems Inc., is currently serving as the 10th President of Stanford University.
..... Click the link for more information.
For other persons of the same name, see David Patterson.
David A. Patterson has been Professor of Computer Science at the University of California, Berkeley since 1977, after receiving his A.B. (1969), M.S. (1970), and Ph.D. (1976) from UCLA...... Click the link for more information.
This article is copied from an article on Wikipedia.org - the free encyclopedia created and edited by online user community. The text was not checked or edited by anyone on our staff. Although the vast majority of the wikipedia encyclopedia articles provide accurate and timely information please do not assume the accuracy of any particular article. This article is distributed under the terms of GNU Free Documentation License.
Herod_Archelaus