Citizendia
Your Ad Here

Machine code or machine language is a system of instructions and data directly executed by a computer's central processing unit. A computer is a Machine that manipulates data according to a list of instructions. Machine code may be regarded as a primitive (and cumbersome) programming language or as the lowest-level representation of a compiled and/or assembled computer program. A programming language is an Artificial language that can be used to write programs which control the behavior of a machine particularly a Computer. A compiler is a Computer program (or set of programs that translates text written in a computer language (the source language) into another See the terminology section below for information regarding inconsistent use of the terms assembly and assembler Computer programs (also software programs, or just programs) are instructions for a Computer. Programs in interpreted languages (often BASIC, Matlab, Smalltalk, Python, Ruby, etc), are not represented by machine code however, although their interpreter (which may be seen as a processor executing the higher level program) often is. In Computer programming, BASIC (an Acronym for Beginner's All-purpose Symbolic Instruction Code) is a family of High-level programming languages MATLAB is a numerical computing environment and Programming language. Smalltalk is an object-oriented, dynamically typed, reflective programming language. Python is a general-purpose High-level programming language. Its design philosophy emphasizes programmer productivity and code readability Ruby is a dynamic, reflective, general purpose Object-oriented programming language that combines syntax inspired by Perl with Smalltalk Machine code is also referred to as native code, a term that, in the context of an interpreted language, may refer to the platform-dependent implementation of language features and libraries. In Computer programming an interpreted language is a Programming language whose implementation often takes the form of an interpreter. [1]

Contents

Machine code instructions

Instructions are patterns of bits with different patterns corresponding to different commands to the machine. In Computer science, an instruction is a single operation of a processor defined by an Instruction set architecture. A bit is a binary digit, taking a value of either 0 or 1 Binary digits are a basic unit of Information storage and communication

Every CPU model has its own machine code, or instruction set. An instruction set is a list of all the instructions and all their variations that a processor can execute 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 because 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"). In computer technology an opcode ( op eration code) is the portion of a Machine language instruction that specifies the operation to be performed Other fields may give the type of the operands, their location, or their value directly (operands contained in an instruction are called immediate). In Mathematics, an operand is one of the inputs (arguments of an Operator. Addressing modes are an aspect of the Instruction set architecture in most Central processing unit (CPU designs Some exotic instruction sets do not have an opcode field (such as Transport Triggered Architectures or the Forth virtual machine), only operand(s). The transport triggered architecture ( TTA) is an Application-specific instruction-set processor ( ASIP) architecture template that allows easy customization In Computer science, the term threaded code refers to a Compiler implementation technique where the generated code has a form that essentially consists entirely Other instruction sets lack any operand fields, such as NOSCs[2].

Programs

A computer 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. A superscalar CPU architecture implements a form of parallelism called Instruction-level parallelism within a single processor

Program flow may be influenced by special 'jump' instructions that transfer execution to an instruction other than the following one. In Computer science control flow (or alternatively flow of control refers to the order in which the individual statements, instructions or Function Conditional jumps are taken (execution continues at another address) or not (execution continues at the next instruction) depending on some condition. 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

Assembly languages

Main article: Assembly language

A much more readable rendition of machine language, called assembly language, uses mnemonic codes to refer to machine code instructions, rather than simply using the instructions' numeric values. See the terminology section below for information regarding inconsistent use of the terms assembly and assembler See the terminology section below for information regarding inconsistent use of the terms assembly and assembler A mnemonic device (nəˈmɒnɪk is a Memory aid Commonly met mnemonics are often verbal something such as a very short poem or a special word used to help a person remember For example, on the Zilog Z80 processor, the machine code 00000101, which causes the CPU to decrement the B processor register, would be represented in assembly language as DEC B. The Zilog Z80 is an 8-bit Microprocessor designed and sold by Zilog from July 1976 onwards 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

Example

The MIPS architecture provides a specific example for a machine code whose instructions are always 32 bits long. MIPS (originally an acronym for Microprocessor without Interlocked Pipeline Stages) is a RISC microprocessor architecture developed by MIPS Technologies 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 1024:

[  op  |        target address        ]
    2                 1024               decimal
 000010 00000 00000 00000 00100 000000   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. In Computer engineering, computer architecture is the conceptual design and fundamental operational structure of a Computer system Microprogramming (ie writing microcode) is a method that can be employed to implement Machine instructions in a CPU relatively easily often using less Dataflow is a term used in Computing, and may have various shades of meaning This is done to facilitate porting of machine language programs between different models. See also Software portability In Computer science, porting is the process of adapting software so that an executable program can be created An example of this use is the IBM System/360 family of computers and their successors. The IBM System/360 ( S/360) is a Mainframe computer system family announced by IBM on April 7, 1964. 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. An emulator duplicates (provides an emulation of the functions of one System using a different system so that the second system behaves like (and appears to 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. The IBM 1400 series were second generation ( Transistorized mid-range business Computers that IBM sold

See also

Further reading

Dictionary

machine code

-noun

  1. (computer science) System of instructions and data directly understandable by a computer's central processing unit.
© 2009 citizendia.org; parts available under the terms of GNU Free Documentation License, from http://en.wikipedia.org
Dapyx Software network: MP3 Explorer | Ebook Manager | Zenithic