Skip to content

Instantly share code, notes, and snippets.

@nedgrady
Last active June 23, 2019 15:18
Show Gist options
  • Save nedgrady/ea5558f4d788bdbc1f2abc8b72ccf096 to your computer and use it in GitHub Desktop.
Save nedgrady/ea5558f4d788bdbc1f2abc8b72ccf096 to your computer and use it in GitHub Desktop.
class MyClass { }
// Compiles into...
// Constructor declaration, remember a construcor is just a method under the hood.
MyClass..ctor:
// Push argument 0 onto the stack. Any CIL instance methods have an Argument 0
// which is a pointer to the current object the method being is called upon, 'this', in C#
IL_0000: ldarg.0
// Call our base class constructor on this.
IL_0001: call System.Object..ctor
IL_0006: nop
// Return from our method.
IL_0007: ret
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment