Docstoc

Bit operations

Document Sample
Bit operations Powered By Docstoc
					Exam review
                Bit operations
• Definition of bitwise operations
  – e.g. Arithmetic vs. logical shifts
• Apply bit operations to some input
• Produce bit operations to give a desired
  output
    Unsigned/Two’s complement
• Bit-level representation of integers
• Convert values to unsigned/two’s comp.
• Integer arithmetic
  – Overflow
  – Correct division
• Special values
  – Bit representation of TMAX, TMIN, -1
• Answer questions for very short ints
               Floating point
• IEEE 754
• Classes of values
  – Normalized
  – Denormalized
  – +/- Inf, NaN
• Convert fractions to binary
• Convert to floating point (maybe restricted
  formats)
      Bit operations -> int/float
• Answer questions about ints/floats using
  bitwise operations
           Transforming loops
• Transform for -> while -> do-while -> goto
               Reading IA32
• Recognize IA32 instructions, idioms
  – Function setup
  – Loading arguments
  – Loops
  – Addressing modes, lea
• Decompile IA32 code
                 Writing Y86
• Know Y86 instruction set
  – Much more like a load-store architecture
  – Conditional operations
• Produce Y86 for simple functions
• Translate x86 to Y86
   Condition codes & instructions
• Set condition codes for arithmetic operations
• test/cmp in X86
  – Equivalent ops in Y86
• Correctly combine op. with a conditional
  instruction
  – jXX, cmovXX
                 Alignment
• Internal struct alignment
• Struct alignment
    Reasoning about instructions
• Break down instructions
  – e.g. push,pop
• Interpret instructions in new environments

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:0
posted:11/4/2013
language:English
pages:11