Skip to content

Instantly share code, notes, and snippets.

@einarwh
Last active December 27, 2015 10:19
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 einarwh/7310419 to your computer and use it in GitHub Desktop.
Save einarwh/7310419 to your computer and use it in GitHub Desktop.
Bytecode for the rewritten Add method.
.method private hidebysig static
int32 Add (
int32 x,
int32 y
) cil managed
{
// Method begins at RVA 0x2088
// Code size 18 (0x12)
.maxstack 8
IL_0000: ldarg.0
IL_0001: ldc.i4.0
IL_0002: bgt.s IL_0006
IL_0004: ldarg.1
IL_0005: ret
IL_0006: ldarg.0
IL_0007: ldc.i4.1
IL_0008: sub
IL_0009: ldarg.1
IL_000a: ldc.i4.1
IL_000b: add
IL_0010: starg 1
IL_0011: starg 0
IL_0012: br.s IL_0000
} // end of method Program::Add
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment