0

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
    }
user2201747
  • 159
  • 1
  • 2
  • 9

1 Answers1

3

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

Ondrej Svejdar
  • 21,349
  • 5
  • 54
  • 89