سؤال

I'm trying to figure il code out, but cannot understand why next code crashed. When I use the same code without next row:call string [mscorlib]System.Console::ReadLine() code behavior are expected, but adding above described row force crash. What's wrong in this statement??

.assembly Hello {}
    .method public static void SomeFunction() cil managed
    {
         .entrypoint
         ldstr "Hello, world!"
         call void [mscorlib]System.Console::WriteLine(string)
         call string [mscorlib]System.Console::ReadLine()
         ret
    }
هل كانت مفيدة؟

المحلول

ReadLine is returning string, so I guess there should be "pop" before ret ?

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top