Thanks Chip I shall do so. Here is what I would do please tell me if this will 
work. Andrew really speaking I don't care what the assembly program does all I 
need is that I transition from executing from a regular C code to pure assembly 
and back. Please don't ask me why I want to do that ... :)
Thanks
Ananda

File 1:
Junk.c:
EFI_STATUS
EFIAPI
UefiMain (
  IN EFI_HANDLE        ImageHandle,
  IN EFI_SYSTEM_TABLE  *SystemTable
  )
{
     RunAsmCode();
}
File 2:
Bunk.asm


    LEAF_ENTRY RunAsmCode, _TEXT$00

        push    rbx
        push    rax
        push    rcx
        push    rdx

        mov     ebx, ecx

        mov     ecx, 0ffffffffh
               /* More code will come here */
        pop     rdx
        pop     rcx
        pop     rax
        pop     rbx
        ret
    LEAF_END RunAsmCode, _TEXT$00

    end

From: Chip Ueltschey [mailto:[email protected]]
Sent: Wednesday, July 17, 2013 1:54 PM
To: Vardhana, Ananda
Cc: [email protected]
Subject: Re: [edk2] How to run assembly code in EFI

Inline assembly is not supported for 64-bit code.
You would need to put your assembly code in a separate file.
-chip

On Wed, Jul 17, 2013 at 1:29 PM, Vardhana, Ananda 
<[email protected]<mailto:[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

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]<mailto:[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