Inline assembler is non portable and should never be in generic code. So you 
need to write .asm/.s files (VC++/GNU).

The general answer for edk2 is DON'T write assembler, use C code. There are C 
APIs in the edk2 MdePkg that perform a lot of the common operations, that are 
implemented in an optimized way for all the supported compilers (VC++, GCC, 
clang, etc.). 
https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2/MdePkg/Include/Library/BaseLib.h
https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2/MdePkg/Include/Library/IoLib.h

So why do you need assembly code?

Thanks,

Andrew Fish



On Jul 17, 2013, at 1:29 PM, "Vardhana, Ananda" <[email protected]> 
wrote:

> I am new to EFI and have a very simple question. I want to compile this 
> following short program. I am running on a 64 bit machine and the EDKII is 
> also 64 bit. I have tried with _asm and __asm both failed. Might be I have to 
> use () instead of {}? I don’t know. Help pelase
>  

VC++ does not support inline assembly in X64. Good call on their part. 

> EFI_STATUS
> EFIAPI
> UefiMain (
>   IN EFI_HANDLE        ImageHandle,
>   IN EFI_SYSTEM_TABLE  *SystemTable
>   )
> {
>  
>         _asm {
>                 push    ebx
>          push    eax
>          push    ecx
>          push    edx
>         /* Other code follows*/
> }
> }
>  
>  
>  
>  
>  
>  
> ------------------------------------------------------------------------------
> See everything from the browser to the database with AppDynamics
> Get end-to-end visibility with application monitoring from AppDynamics
> Isolate bottlenecks and diagnose root cause in seconds.
> Start your free trial of AppDynamics Pro today!
> http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk_______________________________________________
> edk2-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/edk2-devel

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to