Microsoft Intermediate language - PowerPoint PPT Presentation

1 / 8
About This Presentation
Title:

Microsoft Intermediate language

Description:

A (zero-based) array of local variable. A (zero-based) array of ... ret. Ilasm hello.cil. MSIL Instruction Set. Argument, local variables, Constant, pointers ... – PowerPoint PPT presentation

Number of Views:116
Avg rating:3.0/5.0
Slides: 9
Provided by: mohamma4
Category:

less

Transcript and Presenter's Notes

Title: Microsoft Intermediate language


1
Microsoft Intermediate language
  • CLI vs. JVM

2
Why intermediate language?
  • Portability
  • Compactness
  • Efficiency
  • Security
  • Interoperability

3
CLI (Common Language Infrastructure)Architecture
  • A linked list of stack frames
  • IP (Instruction Pointer)
  • Evaluation stack
  • A (zero-based) array of local variable
  • A (zero-based) array of incoming arguments
  • Method info handle
  • A local memory pool
  • A return state handle
  • A security descriptor

4
A simple example
//hello.cil .assembly hello .ver
1000 .method public static void main() il
managed .entrypoint .maxstack
1 ldstr "Hello World with IL\n
call void mscorlibSystem.ConsoleWriteLine(
class System.String) ret
Ilasm hello.cil
5
MSIL Instruction Set
  • Argument, local variables, Constant, pointers
  • ldc.t v, ldarg n, ldloc n, ldloca n,stloc n
    ldind.t
  • Arithmetic
    add, sub
  • Control flow
    br, beq, bge

6
MSIL Instruction Set( value types)
  • Structures
  • .class value Point
  • .field public int x
  • .field public int y
  • Unions
  • .class value explicit FloatOrInt
  • .field 0 public float32 f
  • .field 0 public int32 n
  • Enum
  • .class enum Shape
  • .field public static valuetype Shape RECTANGLE
    int32(0)
  • .field public static valuetype Shape CIRCLE
    int32(1)

7
MSIL Instruction Set( reference types)
  • Classes
  • Interfaces
  • Arrays
  • Delegates

8
.NET vm vs. JVM
  • Purpose
  • Object oriented model
  • Stack slots
  • Type of instructions
  • Code density
  • Number of instructions
Write a Comment
User Comments (0)
About PowerShow.com