FACTOID # 60: Japan's water has a very high dissolved oxygen concentration - but not enough to prevent drowning in the bath.
 
 Home   Encyclopedia   Statistics   Countries A-Z   Flags   Maps   Education   Forum   FAQ   About 
 
WHAT'S NEW
RECENT ARTICLES
More Recent Articles »
 

SEARCH ALL

FACTS & STATISTICS    Advanced view

Search encyclopedia, statistics and forums:

 

 

(* = Graphable)

 

 


Encyclopedia > Basic block

In computing, a basic block is a straight-line piece of code without any jumps or jump targets in the middle; jump targets, if any, start a block, and jumps end a block. Basic blocks are usually the basic unit to which compiler optimizations are applied in compiler theory. Basic blocks form the vertices or nodes in a control flow graph.


More formally, we say a sequence of instructions forms a basic block if the instruction in each position dominates, or always executes before, all those in later positions, and no other instruction executes between two instructions in the sequence. This definition is more general than the intuitive one in some ways. For example, it allows unconditional jumps to labels not targeted by other jumps. This definition embodies the properties that make basic blocks easy to work with when constructing an algorithm.


The blocks to which control may transfer after reaching the end of a block are called that block's successors, while the blocks from which control may have come when entering a block are called that block's predecessors.


The algorithm for generating basic blocks from a listing of code is simple: you scan over the code, marking block boundaries, which are instructions which may either begin or end a block because they either transfer control or accept control from another point. Then, the listing is simply "cut" at each of these points, and basic blocks remain. Note that this method does not always generate maximal basic blocks, by the formal definition, but they are usually sufficient.


Instructions that end a basic block include

  • Unconditional and conditional branches, both direct and indirect.
  • Returns to a calling procedure
  • Instructions which may throw an exception
  • Function calls can be at the end of a basic block if they may not return, such as functions which throw exceptions or special calls like C's longjmp and exit.

Instructions which begin a new basic block include

  • Procedure entry points
  • Targets of jumps or branches
  • "Fall-through" instructions following some conditional branches
  • Instructions following ones that throw exceptions
  • Exception handlers

Note that, because control can never pass through the end of a basic block, some block boundaries may have to be modified after finding the basic blocks. In particular, fall-through conditional branches must be changed to two-way branches, and function calls throwing exceptions must have unconditional jumps added after them. Doing these may require adding labels to the beginning of other blocks.


See also: control flow graph


  Results from FactBites:
 
Basic Block Machine Work (1985 words)
To deck a block, all four corners of the block are measured to the centerline of the mains (crankshaft) to determine if the block is square (also to set deck height).
If the block is off, the head surface is machined until it measures the same, rear to front and side to side (0.001 to maximum tolerance).
Also, the block, when decked, is surfaced on a mill using a special squaring fixture to ensure a perfect 90-degree angle to the centerline of the crankshaft.
EPAA Vol. 7 No. 29 Veal & Schreiber: Block Scheduling Effects (3558 words)
Block mathematics is an ideal format for obtaining more credits in mathematics, but the block format does little for mathematics achievement and conceptual understanding.
Thus, the argument that block scheduling would allow more students to take more mathematics classes is true, the impact of the increased learning is not justified due to the lack of time and curriculum in the mathematics classes due to the shorter class hours in the block format.
In essence, block mathematics is good for taking more mathematics classes and obtaining more graduation credits, but the block format per se does little to increase students' understanding of mathematics.
  More results at FactBites »


 

COMMENTARY     


Share your thoughts, questions and commentary here
Your name
Your comments
Please enter the 5-letter protection code

Want to know more?
Search encyclopedia, statistics and forums:

 


Lesson Plans | Student Area | Student FAQ | Reviews | Press Releases |  Feeds | Contact
The Wikipedia article included on this page is licensed under the GFDL.
Images may be subject to relevant owners' copyright.
All other elements are (c) copyright NationMaster.com 2003-5. All Rights Reserved.
Usage implies agreement with terms.