// (C) 2003 Jackson Harper, All rights reserved
//
.assembly extern mscorlib { }
-.assembly HelloWorld { }
-.module HelloWorld.exe
+
+//
+// Declare a namespace, a class, and a method
+//
.namespace Mono.ILASM.Tests {
.class public auto ansi Test_1 extends [mscorlib]System.Object {
- .method public instance void .ctor () cil managed {
- ldstr "In Constructor"
- }
-
.method public static void check(string) cil managed {
.entrypoint
.maxstack 1
- .locals init ([mscorlib]System.Object V_0)
-
- ldnull
- pop
-
- nop
- nop
-
- newobj void Mono.ILASM.Tests.Test_1::.ctor ()
-
- ldstr "Hello World."
- call void Mono.ILASM.Tests.Test_1::check (string)
- ldstr "Hello World"
- call instance void Mono.ILASM.Tests.Test_1::a ()
- ldfld void [mscorlib]System.Object::a
-
- initobj Mono.ILASM.Tests.Test_1
-
- ret
+ nop
}
-
- .method public static void a ()
- {
-
- }
}
}
// (C) 2003 Jackson Harper, All rights reserved
//
.assembly extern mscorlib { }
-.assembly test_10 { }
-.module test_10.exe
+
+
+//
+// Create some bound arrays
+//
.namespace Mono.ILASM.Tests {
// (C) 2003 Jackson Harper, All rights reserved
//
.assembly extern mscorlib { }
-.assembly test_11 { }
-.module test_11.exe
+
+//
+// Create a generic type
+//
.namespace Mono.ILASM.Tests {
- .class public auto ansi Test_10<int32> extends [mscorlib]System.Object {
+ .class public Test_11<int32 name_a_a_1, int32 name_a_a_a_2> extends [mscorlib]System.Object {
}
+
}
\ No newline at end of file
// (C) 2003 Jackson Harper, All rights reserved
//
.assembly extern mscorlib { }
-.assembly HelloWorld { }
-.module HelloWorld.exe
+
+//
+// Declare a local object instantiate it and print it to stdout
+//
.namespace Mono.ILASM.Tests {
.class public auto ansi Test_2 extends [mscorlib]System.Object {
- .method public static void check( ) cil managed {
+ .method public static void main () cil managed {
.entrypoint
.maxstack 1
.locals init (object obj)
// (C) 2003 Jackson Harper, All rights reserved
//
.assembly extern corlib { }
-.assembly HelloWorld { }
-.module HelloWorld.exe
+
+//
+// Define a method and execute that method
+//
.namespace Mono.ILASM.Tests {
}
.method private static void print_hello() cil managed {
- ldstr "Hello, World!"
+ ldstr "PASS"
call void [corlib]System.Console::WriteLine(string)
}
// (C) 2003 Jackson Harper, All rights reserved
//
.assembly extern corlib { }
-.assembly HelloWorld { }
-.module HelloWorld.exe
+
+//
+// Pass a param to a method
+//
.namespace Mono.ILASM.Tests {
.entrypoint
.maxstack 1
- ldstr "Hello, World!"
+ ldstr "PASS"
call void Mono.ILASM.Tests.Test_4::print_string(string)
ret
// (C) 2003 Jackson Harper, All rights reserved
//
.assembly extern mscorlib { }
-.assembly test_5 { }
-.module test_5.exe
+
+//
+// Define a field
+//
.namespace Mono.ILASM.Tests {
// (C) 2003 Jackson Harper, All rights reserved
//
.assembly extern mscorlib { }
-.assembly test_6 { }
-.module test_6.exe
-.namespace Mono.ILASM.Tests {
-
- .class public auto ansi A extends [mscorlib]System.Object {
- }
+//
+// Define classes outside of namespaces, also define a field that
+// references a type in this assembly
+//
- .class public auto ansi Test_6 extends [mscorlib]System.Object {
-
- /// <summary>
- /// Field that references a type in this assembly
- /// </summary>
- .field public Mono.ILASM.Tests.A a_field
- }
+.class public auto ansi Test_6 extends [mscorlib]System.Object {
+ /// <summary>
+ /// Field that references a type in this assembly
+ /// </summary>
+ .field public class A a_field
}
+.class public auto ansi A extends [mscorlib]System.Object {
+
+}
//
.assembly extern mscorlib { }
.assembly extern Cscompmgd { }
-.assembly test_7 { }
-.module test_7.exe
+
+
+//
+// Define a method that references a type in another assembly (that is
+// not corlib)
+//
.namespace Mono.ILASM.Tests {
// (C) 2003 Jackson Harper, All rights reserved
//
.assembly extern mscorlib { }
-.assembly test_8 { }
-.module test_8.exe
+
+//
+// Implement an interface
+//
.namespace Mono.ILASM.Tests {
- .class public auto ansi Test_8 extends [mscorlib]System.Object {
-
- }
-
- .class public auto ansi A
+ .class public auto ansi Test_8
extends [mscorlib]System.Collections.ArrayList
- implements [mscorlib]System.Collections.IList, [mscorlib]System.Object {
+ implements [mscorlib]System.Collections.IList {
}
}
// (C) 2003 Jackson Harper, All rights reserved
//
.assembly extern mscorlib { }
-.assembly test_9 { }
-.module test_9.exe
+
+//
+// Call a constructor for a type defined in this assembly
+//
.namespace Mono.ILASM.Tests {