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?