Hi sirs,
I tested Thunk16.nasm too. For x86_64 there is no issue.
For ia32 compilation disasm shows not good codes
---------
00000000 <m16Start>:
   0:   00 00                   add    %al,(%eax)
   2:   00 00                   add    %al,(%eax)
        ...

00000006 <_BackFromUserCode>:
   6:   16                      push   %ss
   7:   0e                      push   %cs
   8:   67 e8 00 00 66 9c       addr16 call 9c66000e 
<InternalAsmThunk16+0x9c65ff36>

0000000c <_BackFromUserCode.Base>:
   c:   66 9c                   pushfw 
   e:   fa                      cli    

---------
to compare gcc-4.9.1 cvompilation
---------
00000000 <m16Start>:
   0:   00 00                   add    %al,(%eax)
   2:   00 00                   add    %al,(%eax)
        ...

00000006 <BackFromUserCode>:
   6:   16                      push   %ss
   7:   0e                      push   %cs
   8:   66 e8 00 00             callw  c <BackFromUserCode+0x6>
        ...

0000000e <L_Base1>:
   e:   66 9c                   pushfw 
  10:   fa                      cli    

----------
May be change a32 prefix to o32 in the line:
"a32 call    .Base                       ; push eip"
?

Wishes,
Sergey

On 27.08.2014, at 9:50, Jordan Justen wrote:

> On Tue, Aug 19, 2014 at 4:57 PM, Jordan Justen
> <[email protected]> wrote:
>> This series:
>> * Adds support for creating object files from .nasm source files to
>>   allow NASM source files to be linked into libraries and images
>> * Adds NASM source files for Thunk16 on IA32 and X64
>> * Convert BaseLib to use NASM Source Files for Thunk16 rather than
>>   GNU Assembler (.S) files
>>   - This will make NASM a build requirement for MdePkg with IA32 &
>>     X64 on all toolchains except MSVC and ICC.
>> 
>> Thanks for Liming Gao for the tools_def changes for MSVC. (But, these
>> have not been tested very well yet.)
>> 
>> This series is available in this git branch:
>> https://github.com/jljusten/edk2.git nasm-v1
> 
> I update my nasm branch based on the feedback.
> 
> The differences vs. v1 are in the attached patch.
> 
> Is anyone interested in seeing a v2 posted to the list?
> 
> Liming, in patch 1, I mentioned I only tested with GCC49. Did you have
> any testing to add to that?
> 
> -Jordan
> 
>> Jordan Justen (8):
>>  BaseTools/tools_def: Add NASM_FLAGS
>>  BaseTools/build_rule: Add .nasm => .obj build rule
>>  MdePkg/Base.h: Always define ASM_PFX
>>  MdePkg/BaseLib Thunk16: Replace IA32 GAS Thunk16 with NASM version
>>  MdePkg/BaseLib Thunk16: Replace X64 GAS Thunk16 with NASM version
>>  MdePkg/BaseLib NASM Thunk16: Use NASM local labels
>>  MdePkg/BaseLib NASM Thunk16: Use bits 16 for 16-bit code
>>  MdePkg/BaseLib NASM Thunk16: Remove remaining 'DB' code
>> 
>> BaseTools/Conf/build_rule.template       |  15 ++
>> BaseTools/Conf/tools_def.template        | 287 ++++++++++++++++++++++++++-
>> MdePkg/Include/AArch64/ProcessorBind.h   |   4 +
>> MdePkg/Include/Arm/ProcessorBind.h       |   4 +
>> MdePkg/Include/Base.h                    |  25 ++-
>> MdePkg/Include/Ebc/ProcessorBind.h       |   4 +
>> MdePkg/Include/Ia32/ProcessorBind.h      |   4 +
>> MdePkg/Include/Ipf/ProcessorBind.h       |   4 +
>> MdePkg/Include/X64/ProcessorBind.h       |   4 +
>> MdePkg/Library/BaseLib/BaseLib.inf       |   4 +-
>> MdePkg/Library/BaseLib/Ia32/Thunk16.nasm | 260 +++++++++++++++++++++++++
>> MdePkg/Library/BaseLib/X64/Thunk16.nasm  | 321 
>> +++++++++++++++++++++++++++++++
>> 12 files changed, 914 insertions(+), 22 deletions(-)
>> create mode 100644 MdePkg/Library/BaseLib/Ia32/Thunk16.nasm
>> create mode 100644 MdePkg/Library/BaseLib/X64/Thunk16.nasm
>> 
>> --
>> 2.1.0
>> 
>> 
>> ------------------------------------------------------------------------------
>> Slashdot TV.
>> Video for Nerds.  Stuff that matters.
>> http://tv.slashdot.org/
>> _______________________________________________
>> edk2-devel mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/edk2-devel
> <compare-nasm-to-nasm-v1.patch>------------------------------------------------------------------------------
> Slashdot TV.  
> Video for Nerds.  Stuff that matters.
> http://tv.slashdot.org/_______________________________________________
> edk2-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/edk2-devel

------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to