SIL

posted in The Broken Mind
Published July 14, 2008
Advertisement
Ive been working on a compiler and trying to learn about CIL at the same time.
So I worked up a few examples using a simplified version of CIL and have been working on a compiler to take that simplified CIL (lets call it.. SIL? haha) and compile it into CIL.

SIL so far in my design just makes it so that you dont have to set .maxstack, adds a MOV instruction, you use a the same instruction for pushing/popping off the stack no matter what it is, and it slims down on method calling.

Heres an example of SIL and then the equivalent CIL:
int32 amov a 50 //now you dont have to push 50 on the stack and then pop it into ald "Hello"call System.Console::Writeret


  .locals init (int32 a)  ldc.i4 50   stloc a   ldstr "Hello"    call void [mscorlib]System.Console::Write(string)  ret


The compiler is very crude and hacked together at the moment but it does do some things. Next thing I want to do is clean up the compiler code and organize it into classes and such.
Previous Entry Yay!
Next Entry Smooth Sailing
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement

Latest Entries

26 Games 26 Weeks

1842 views

Celenite

1366 views

Im back...again!

1195 views

Tunnel Syndrome

1505 views

Borderlands

1420 views

First Flash Game

1183 views

First Flash Game

1481 views

Bullet holes? Yum!

1313 views

Game 2

1246 views

New Project

1082 views
Advertisement