Forgot your password?  

Not What You Meant?  There are 20 definitions for Primitive.  Also try: Program code.

Machine Code | Research & Encyclopedia Articles

Print-Friendly   Order the PDF version   Order the RTF version
About 2 pages (683 words)
Machine code Summary

 


Machine Code

Machine code is the sequence of binary-coded machine instructions specifically written to be used within machine language. Machine language is the low-level programming language that is directly read and interpreted by a computer's central processing unit (CPU) in order for it to perform its functions. The instructions within machine code are binary strings that may be either all the same size (e.g., one 32-bit word) or of different sizes (where the size of the instruction is determined from the first word or byte). For instance, when a CPU is set-up to use 32-bit words, it realizes that it only needs to scan that particular sequence of bits in order to perform all of its instructions.

Many of the computer programs "coded" by mathematical programmers from the mid-1940s to the late-1950s were written in the binary (base 2) numbering system--while some were written in octal (base 8) or hexadecimal (base 16)--using low-level machine languages. Programs in machine code were not usually very large, only consisting of hundreds or thousands of separate instructions that were very simple in structure when compared to modern high-level programs. These machine codes were written specifically for a particular machine, until the first high-level programming language FORTRAN (Formula Translator) became available in 1958.

A program in machine code normally consists of sequences of binary digits, or bits, which are represented by 1s and 0s that make up the machine instructions. These bits, the smallest piece of information used by the CPU, form the basic instructions that direct the operation of a computer. When computer programs were written in machine code, it was difficult for programmers to read and follow the language because the instructions appeared as sequences of bits (i.e., zeros and ones). Because of this, errors were very difficult to detect within the numerous rows and columns of zeros and ones. Today errors are much easier to detect with the use of alphanumeric words for commands within high-level code. In addition, writing programs in machine code consumed much time and effort because computer programmers had to organize each specific bit in an instruction; and with thousands or millions of lines of code, those tasks became quite daunting.

Execution of machine code may be permanently hard-wired into the CPU (as in personal computers) or the execution may be controlled by microcode. A microcode is a technique for implementing the instruction set of a microprocessor as a sequence of instructions ("microinstructions"), each of which typically consists of a large number of bit fields and the address of the next microinstruction to execute. (The collection of all possible instructions for a particular computer is known as its "instruction set".) The fundamental execution cycle of machine code consists of (1) grabbing the next instruction from main memory, (2) decoding it (determining the operation that it specifies and the location of any independent variables), (3) executing it by opening various gates (electronic switches that allow data to flow from main memory into a CPU memory register), and (4) enabling functional units (subsystems within the CPU that perform certain distinct functions). The specific set of instructions that constitutes a machine code depends on the make and model of the microprocessor (the computer's CPU) inside a particular computer. For instance, the machine code for the Motorola 68000 microprocessor differs from that used in the Intel Pentium® microprocessor.

These days almost all computer programmers use assembly (intermediate) languages or high-level languages when programming for computers (instead of machine language). An assembly language contains a one-to-one correspondence with the resulting machine code instructions, but the instructions and variables possess familiar names instead of being just numbers. Like assembly languages, all high-level languages must first be translated into machine code before a computer can run them. To accomplish this, programmers use various types of utility programs (such as compilers, assemblers, linkers, and debuggers) that help them translate high-level language into machine code. The computer code used to write a program is called source code before being translated into machine code, which is called object code. Thus, machine code is the ultimate result of the compilation of assembly language or any high-level language.

This is the complete article, containing 683 words (approx. 2 pages at 300 words per page).

More Information
  • View Machine Code Study Pack
  • 20 Alternative Definitions
  • Search Results for "Machine Code"
  • More Products on This Subject
    Machine Language
    Machine language is the programming language the computer understands; its native tongue. Machine l... more

    Machine Language
    In the late 1940s and early 1950s, the introduction of the electronic digital computer was greeted ... more


    Ask any question on Machine code and get it answered FAST!
    Answer questions in BookRags Q&A and earn points toward
    discounted or even FREE Study Guides and other BookRags products!
    Learn more about BookRags Q&A
    Copyrights
    Machine Code from World of Computer Science. ©2005-2006 Thomson Gale, a part of the Thomson Corporation. All rights reserved.

    Join BookRagslearn moreJoin BookRags

    Join BookRagslearn moreJoin BookRags