Register calling convention for asm functions...

Mikola Lysenko mclysenk at mtu.edu
Mon Mar 12 14:52:36 PDT 2007


Chris Warwick wrote:
> What do i need to do to get register calling convention for asm? I've found 
> extern(C) for cdecl calling convention, and i have seen mention of the 
> 'naked' keyword but cant work out where it goes... im not even sure if it 
> does cause register calling convention or just causes the compiler to omit 
> entry and exit code.
> 
> I assume it must be possible to write asm functions that take arguments in 
> the eax,ecx,edx registers?
> 
> thanks,
> 
> cw 
> 
> 

Yes, and no.  The D calling convention differs from compiler to 
compiler.  GDC uses an extension of extern(C), while DMD follows a 
convention similar to Win32's stdcall.  As a result, this makes it a bad 
idea to use 'naked' within a D function.

Hope this helps.

-Mik


More information about the Digitalmars-d-learn mailing list