Skip to content

Instantly share code, notes, and snippets.

@dgrunwald
Created October 13, 2017 15:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dgrunwald/e951f151f1f3e7e1ea791cb4e2e117e8 to your computer and use it in GitHub Desktop.
Save dgrunwald/e951f151f1f3e7e1ea791cb4e2e117e8 to your computer and use it in GitHub Desktop.
.assembly extern mscorlib
{
.publickeytoken = (B7 7A 5C 56 19 34 E0 89 )
.ver 4:0:0:0
}
.assembly StackTests
{
.hash algorithm 0x00008004
.ver 1:0:4059:39717
}
.module StackTests.exe
.imagebase 0x00400000
.file alignment 0x00000200
.stackreserve 0x00100000
.subsystem 0x0003 // WINDOWS_CUI
.corflags 0x00000001 // ILONLY
.class private auto ansi beforefieldinit StackTests.Program extends [mscorlib]System.Object
{
.method public hidebysig static void Main(string[] args) cil managed
{
.entrypoint
.maxstack 8
ldc.i4 0x7fffffff
call native int StackTests.Program::Int32OrNative(int32)
box native int
call void [mscorlib]System.Console::WriteLine(object)
ret
}
.method public hidebysig specialname rtspecialname
instance void .ctor() cil managed
{
// Code size 7 (0x7)
.maxstack 8
IL_0000: ldarg.0
IL_0001: call instance void [mscorlib]System.Object::.ctor()
IL_0006: ret
} // end of method Program::.ctor
.method public static native int Int32OrNative(int32 val)
{
.locals (bool v)
ldc.i4.0
// stloc.0
// ldloc.0
brtrue use_native_int
use_i4:
ldarg.0
br after_if
after_if:
ldc.i4.1
add
ret
use_native_int:
ldarg.0
conv.u
br after_if
}
} // end of class StackTests.Program
// =============================================================
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment