All pastes #469963 Raw Edit

KeeperOfTheSoul

public text v1 · immutable
·published 2007-05-04 00:11 UTC
rendered paste body
.assembly Test {
}

.assembly extern mscorlib {}

.class public Test.Foo {
	.method public void .ctor() {
		.maxstack 1

		ldarg.0
		call instance void [mscorlib]System.Object::.ctor()
		
		ldstr "Foo"
		call void [mscorlib]System.Console::WriteLine(string)

		ret
	}
	
	.method public virtual void Test() {
		.maxstack 1
		
		ldstr "Test: Foo"
		call void [mscorlib]System.Console::WriteLine(string)
		
		ret
	}
}

.class public Test.Bar
	extends Test.Foo
{
	
	.method public void .ctor() {
		.maxstack 1
		
		ldarg.0
		call instance void [mscorlib]System.Object::.ctor()
		
		ldstr "Bar"
		call void [mscorlib]System.Console::WriteLine(string)

		ret
	}
	
	.method public virtual void Test() {
		.maxstack 1
		
		ldstr "Test: Bar"
		call void [mscorlib]System.Console::WriteLine(string)
		
		ret
	}
}


.method public static void flibble() {
	.entrypoint
	.maxstack 8
	.locals (
		class Test.Foo a,
		class Test.Bar b
	)
	

	newobj instance void [Test]Test.Foo::.ctor()
	stloc a
	newobj instance void [Test]Test.Bar::.ctor()
	stloc b
	call void [mscorlib]System.Console::WriteLine()

	ldloc a
	call instance void Test.Foo::Test()
	ldloc b
	call instance void Test.Foo::Test()
	call void [mscorlib]System.Console::WriteLine()

	ldloc a
	call instance void Test.Bar::Test()
	ldloc b
	call instance void Test.Bar::Test()
	call void [mscorlib]System.Console::WriteLine()

	ldloc a
	callvirt instance void Test.Foo::Test()
	ldloc b
	callvirt instance void Test.Foo::Test()
	call void [mscorlib]System.Console::WriteLine()
	
	ret
}