Assembly format translator from GCC Gas syntax to Intel for Intel and AMD - ASM x86 ASM 370

This is a discussion on Assembly format translator from GCC Gas syntax to Intel for Intel and AMD - ASM x86 ASM 370 ; I am doing a Win32 port of CLN using VC++ 2005: http://www.ginac.de/CLN/ The stumbling block is down to a few small files (for Intel Assembly). The files are inline assembly C++ files such as: \base\digitseq\cl_asm_i386_.cc which contain GAS format inline ...

+ Reply to Thread
Results 1 to 7 of 7

Assembly format translator from GCC Gas syntax to Intel for Intel and AMD

  1. Default Assembly format translator from GCC Gas syntax to Intel for Intel and AMD

    I am doing a Win32 port of CLN using VC++ 2005:
    http://www.ginac.de/CLN/

    The stumbling block is down to a few small files (for Intel Assembly).
    The files are inline assembly C++ files such as:
    \base\digitseq\cl_asm_i386_.cc
    which contain GAS format inline stuff such as:
    movl %edi,%edx // %edi retten
    Now, it's only a few thousand lines, but still it would be tedious to
    translate it by hand.

    Does anyone know of a Gas ==> INTEL format translator for assembly?


  2. Default Re: Assembly format translator from GCC Gas syntax to Intel for Intel and AMD

    On Mar 2, 12:31 pm, "user923005" <spamt...@crayne.org> wrote:
    > I am doing a Win32 port of CLN using VC++ 2005:http://www.ginac.de/CLN/
    >
    > The stumbling block is down to a few small files (for Intel Assembly).
    > The files are inline assembly C++ files such as:
    > \base\digitseq\cl_asm_i386_.cc
    > which contain GAS format inline stuff such as:
    > movl %edi,%edx // %edi retten
    > Now, it's only a few thousand lines, but still it would be tedious to
    > translate it by hand.
    >
    > Does anyone know of a Gas ==> INTEL format translator for assembly?


    Certainly not that works with in-line assembly files. IIRC, there is a
    (broken) program called something like gas2intel (or att2Intel)
    floating around, but it's for gas source files. And GCC in-line
    assembly is *not* Gas syntax, despite what you might think. It's
    similar, in the way that FASM and NASM are similar, but certainly not
    the same.

    You'd have to manually check every one of those few thousand lines
    anyway, to correct omissions and missed conversions, so I doubt you'd
    save much.

    If it were more than a few thousand lines, I'd just recommend using a
    PERL script to automate a good part of the work. I recently did
    something very similar to convert about 20,000 lines of FASM code to
    HLA syntax.
    Cheers,
    Randy Hyde





  3. Default Re: Assembly format translator from GCC Gas syntax to Intel for Inteland AMD

    user923005 wrote:

    ....
    > Does anyone know of a Gas ==> INTEL format translator for assembly?


    http://membres.lycos.fr/placr/a2i.html

    http://www.niksula.hut.fi/~mtiihone/intel2gas/

    I have no experience with either of these. I doubt if either of them
    will do gcc-inline to vc++-inline, but may be some help.

    Best,
    Frank


  4. Default Re: Assembly format translator from GCC Gas syntax to Intel for Intel and AMD

    "Frank Kotler" <spamtrap@crayne.org> wrote in message
    news:gx2Gh.68$nf5.58@trnddc05...
    > user923005 wrote:
    > ...
    >> Does anyone know of a Gas ==> INTEL format translator for assembly?

    >
    > http://membres.lycos.fr/placr/a2i.html
    >
    > http://www.niksula.hut.fi/~mtiihone/intel2gas/
    >
    > I have no experience with either of these. I doubt if either of them will
    > do gcc-inline to vc++-inline, but may be some help.


    I have used these to do some tranlations of asm files but the resulting
    files have always required quite a lot of manual editing to be of any value.

    As you suggest, it is doubtful that they will cope with inline assembler
    since the parsing that they do is not designed to cope with text that is not
    legal in gas assembly code.

    One possible option is to edit the assembler sections into files, convert
    these files and then splice the results back in to the original files. This
    will inevitably require some manual editing but the bulk of the 'simple'
    changes (removal of %, operand order reversal) will at least be done.

    But, as others have said, it may be easier to write a simple conversion
    routine to make these sort of changes.

    Brian Gladman


  5. Default Re: Assembly format translator from GCC Gas syntax to Intel for Intel and AMD

    On 2 Mar 2007 12:31:22 -0800, "user923005" <spamtrap@crayne.org>
    wrote:

    >I am doing a Win32 port of CLN using VC++ 2005:
    >http://www.ginac.de/CLN/
    >
    >The stumbling block is down to a few small files (for Intel Assembly).
    >The files are inline assembly C++ files such as:
    >\base\digitseq\cl_asm_i386_.cc
    >which contain GAS format inline stuff such as:
    > movl %edi,%edx // %edi retten
    >Now, it's only a few thousand lines, but still it would be tedious to
    >translate it by hand.
    >
    >Does anyone know of a Gas ==> INTEL format translator for assembly?


    Compile/assemble it with gcc, copy the object file to the PC and
    disassemble it with an Intel format disassembler.

    Jim


  6. Default Re: Assembly format translator from GCC Gas syntax to Intel for Intel and AMD

    On Mar 2, 9:31 pm, "user923005" <spamt...@crayne.org> wrote:
    > I am doing a Win32 port of CLN using VC++ 2005:http://www.ginac.de/CLN/
    >
    > The stumbling block is down to a few small files (for Intel Assembly).
    > The files are inline assembly C++ files such as:
    > \base\digitseq\cl_asm_i386_.cc
    > which contain GAS format inline stuff such as:
    > movl %edi,%edx // %edi retten
    > Now, it's only a few thousand lines, but still it would be tedious to
    > translate it by hand.
    >
    > Does anyone know of a Gas ==> INTEL format translator for assembly?


    Would you not just be more prudent using a Windows port of gcc such as
    mingw?, it contains a port of gcc and all the binutils you need for
    porting programs thats sources need gcc to be compiled. GAS is not
    required at all! the assembler normaly distrubuted alongside gcc is AS
    and you get that in mingw in the binutils. Why build a bridge over a
    pond when you can just stroll around the edge to your destination? or
    you could use gcc and friends under Cygwin.

    I realy do not envy the job of having to convert that many lines of
    asm, and unless there are SYSCALL specific things done with the asm
    that would need to be changed under win32 due to lack of SYSCALL under
    Win, i cannot realy see why your not using mingw

    But of course, i've only been programming a short time. I could be
    entirely off mark with this post

    regards and good luck


  7. Default Re: Assembly format translator from GCC Gas syntax to Intel for Intel and AMD

    On 4月5日, 上午2時24分, "KarmaComa" <spamt...@crayne.org> wrote:
    > On Mar 2, 9:31 pm, "user923005" <spamt...@crayne.org> wrote:
    >
    > > I am doing a Win32 port of CLN using VC++ 2005:http://www.ginac.de/CLN/

    >
    > > The stumbling block is down to a few small files (for Intel Assembly).
    > > The files are inline assembly C++ files such as:
    > > \base\digitseq\cl_asm_i386_.cc
    > > which contain GAS format inline stuff such as:
    > > movl %edi,%edx // %edi retten
    > > Now, it's only a few thousand lines, but still it would be tedious to
    > > translate it by hand.

    >
    > > Does anyone know of a Gas ==> INTEL format translator for assembly?

    >
    > Would you not just be more prudent using a Windows port of gcc such as
    > mingw?, it contains a port of gcc and all the binutils you need for
    > porting programs thats sources need gcc to be compiled. GAS is not
    > required at all! the assembler normaly distrubuted alongside gcc is AS
    > and you get that in mingw in the binutils. Why build a bridge over a
    > pond when you can just stroll around the edge to your destination? or
    > you could use gcc and friends under Cygwin.
    >
    > I realy do not envy the job of having to convert that many lines of
    > asm, and unless there are SYSCALL specific things done with the asm
    > that would need to be changed under win32 due to lack of SYSCALL under
    > Win, i cannot realy see why your not using mingw
    >
    > But of course, i've only been programming a short time. I could be
    > entirely off mark with this post
    >
    > regards and good luck



    Hello, I use ATT2Intel.exe to convert gcc asm to Intel,but I got some
    parse error message when I try to parse some psudo instruction and
    declaration, but it's fine for function implementation in the text
    section.
    Could anybody help me ? Or try to tell me how to convert following
    instructions to INTEL syntax by myself.
    Thanks.

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ; .data
    ; .align 16
    ; rounding_sse : .fill 8,2,16
    ; sse_five : .fill 8,2,5
    ; rounding_512 : .fill 4,4,512
    ; tmp_buf : .fill 104,2,0
    ; zero_cmp : .fill 8,2,0
    ; top_cmp : .fill 8,2,255
    ; .align 16
    ; qp_const_array : .word 0,0,0,0,0,0,0,0
    ; .word 1,1,1,1,1,1,1,1
    ; .word 2,2,2,2,2,2,2,2
    ; .word 3,3,3,3,3,3,3,3
    ; .word 4,4,4,4,4,4,4,4
    ; .word 5,5,5,5,5,5,5,5
    ; .word 6,6,6,6,6,6,6,6
    ; .word 7,7,7,7,7,7,7,7
    ; .word 8,8,8,8,8,8,8,8
    ;
    ; .align 16
    ; x264_mmx_32 : .fill 4,2,32
    ; x264_mmx_8 : .fill 4,2,8
    ; x264_mmx_4 : .fill 4,2,4
    ;
    ; .align 16
    ; A_32 : .fill 8,2,32
    ;
    ; .align 16
    ; filter_four : .fill 8,2,4


+ Reply to Thread

Similar Threads

  1. how to call C (non-intel C compiler) from ifort (intel fortran)?
    By Application Development in forum Fortran
    Replies: 4
    Last Post: 10-02-2007, 07:11 PM
  2. AT&T or Intel syntax ?
    By Application Development in forum ASM x86 ASM 370
    Replies: 77
    Last Post: 07-23-2007, 04:10 PM
  3. Re: AT&T or Intel syntax ?
    By Application Development in forum ASM x86 ASM 370
    Replies: 0
    Last Post: 06-28-2007, 02:03 PM
  4. Building in PEF format or Mach-O format for Intel Macs?
    By Application Development in forum basic.visual
    Replies: 8
    Last Post: 07-09-2006, 01:54 AM
  5. Intel Assembly Print out a Running Sum
    By Application Development in forum ASM x86 ASM 370
    Replies: 1
    Last Post: 06-09-2006, 01:48 PM