I'm no assembly guru but I can tell you what's going on.
First thing you'll want to know are the different calling conventions. The call to fun() uses the __cdecl calling convention. When calling member functions, the "thiscall" calling convention is used.
(Notice the above link is "Microsoft Specific", other compilers may implement "thiscall" differently)
The next thing you need to know is the following: (I'm quoting from this article)
From MSDN:
The memory image of an instance of a class has one pointer to the vtable of this class, stored in front of the actual data members of the object. Thus an object that uses virtual functions occupies 4 additional bytes for each instance. The vtable itself occupies 4 bytes for each virtual function, but there is only one vtable per class and it is shared by all instances. When you invoke a virtual function from a base class, the C++ compiler has a pointer to the object's instance data (the "this" pointer). It obtains the pointer to the vtable of the class from the first 4 bytes of the object's instance data. Each virtual function has a unique index in the vtable of a given class. The compiler simply obtains the function address from the vtable at the function's index and branches to this address. When you invoke calls through a pointer to the base class, the technique is the same.
Now we know enough to atleast guess what these lines are doing:
Code:
00431312 mov eax,dword ptr [d] //load "this" into eax
00431315 mov edx,dword ptr [eax] //load vtable pointer into edx
00431317 mov ecx,dword ptr [d] //load "this" into ecx (see "thiscall" calling convention)
0043131A call dword ptr [edx] //vtable has a single entry, f(), at index 0
gg