Created
June 29, 2012 11:44
-
-
Save pietervp/3017514 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
EmitHelper emit = new AssemblyBuilderHelper("HelloWorld.dll") | |
.DefineType ("Hello", typeof(object), typeof(IHello)) | |
.DefineMethod(typeof(IHello).GetMethod("SayHello")) | |
.Emitter; | |
emit | |
// string.Format("Hello, {0}!", toWhom) | |
// | |
.ldstr ("Hello, {0}!") | |
.ldarg_1 | |
.call (typeof(string), "Format", typeof(string), typeof(object)) | |
// Console.WriteLine("Hello, World!"); | |
// | |
.call (typeof(Console), "WriteLine", typeof(string)) | |
.ret() | |
; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment