Pergunta

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
    }
Foi útil?

Solução

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

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top