steven

steven

  • NA
  • 24
  • 41.7k

Who can somebody explain what IL directive "newobj" do in details?

Aug 3 2011 11:49 PM


C# code:
ClassX x = new ClassX();

IL code:
.entrypoint
// Code size 20 (0x14)
.maxstack 1
.locals init ([0] class CSharpExam.ClassX x)
IL_0000: nop
IL_0001: newobj instance void CSharpExam.ClassX::.ctor()




assembly code:
00000035 mov ecx,943738h
0000003a call FFAA1FAC
0000003f mov dword ptr [ebp-44h],eax
00000042 mov ecx,dword ptr [ebp-44h]
00000045 call FFABC108
0000004a mov eax,dword ptr [ebp-44h]
0000004d mov dword ptr [ebp-40h],eax

Here I paste the asembly code of it.




Answers (3)