🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Hm.

posted in The Broken Mind
Published July 12, 2008
Advertisement
I downloaded MS Visual C# 2008 Express and thought id play around with C# since I havnt used it in over a year.

Then I was thinking about the idea of making a compiler that compiled to CIL so I just wasted my whole day on messing with CIL.

If anyone knows MSIL/CIL out there, please tell me why this causes a runtime error:
.assembly hello { }.assembly extern mscorlib { }.method static void main(){    .entrypoint    .maxstack 1    ldstr "Hello, World!"    call void [mscorlib]System.Console::Write(string)    call string [mscorlib]System.Console::ReadLine()    ret}


It worked before I added the ReadLine line so it obviously has something to do with that.
Also, I have .net 3.5 but the highest version of ilasm.exe I can find is 2.0yadayadayada, isnt there a 3.0 or 3.5 version?

EDIT: Fixed the code. Guess I cant leave stuff on the stack! So I made a variable and popped the top value off the stack into it. Isnt there a way to just pop off the stack without having to do anything with the value?
Previous Entry Overwhelmed!
Next Entry Yay!
0 likes 1 comments

Comments

lilljohan
Both 3.5 and 3.0 use the 2.0 CLR.
July 12, 2008 02:03 PM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement

Latest Entries

26 Games 26 Weeks

1730 views

Celenite

1268 views

Im back...again!

1116 views

Tunnel Syndrome

1419 views

Borderlands

1305 views

First Flash Game

1089 views

First Flash Game

1390 views

Bullet holes? Yum!

1205 views

Game 2

1147 views

New Project

1004 views
Advertisement