Code Monkey home page Code Monkey logo

intel2gas's Introduction

Intel2GAS

Convert MASM style inline assembly to AT&T style inline assembly, and output in pure AT&T assembly code or gcc inline assembly code. support x86, x86_64 instructions. It is a brand new replacement to old intel2gas project.

Install

$ git clone https://github.com/skywind3000/Intel2GAS.git Intel2GAS

Convert Assembly in GUI

Run intel2gui.pyw directly, to get into GUI front-end. and convert masm source into AT&T Style (with or without inline mode).

$ cd Intel2GAS

$ python intel2gui.pyw

Convert Without GCC Inline mode

Convert With GCC Inline mode

MMX Alpha Blend Demo

Convert Assembly in Console

$ cd Intel2GAS

$ cat demo.asm

	cld
	mov esi, src
	mov edi, dst
	mov ecx, size
label1:
	mov al, [esi]
	inc al ; calculate
	mov [edi], al
	inc esi
	inc edi
	dec ecx
	jnz label1  ; loop to la
        ret

Convert Without GCC Inline

$ python intel2gas.py -m < demo.asm

    cld
    mov %0, %esi
    mov %1, %edi
    mov %2, %ecx
label1:
    mov (%esi), %al
    inc %al             //calculate
    mov %al, (%edi)
    inc %esi
    inc %edi
    dec %ecx
    jnz label1          //loop to la
    ret

Convert With GCC Inline

$ python intel2gas.py -i -m < demo.asm

__asm__ __volatile__ (
  "    cld\n"
  "    mov %0, %%esi\n"
  "    mov %1, %%edi\n"
  "    mov %2, %%ecx\n"
  "label1:\n"
  "    mov (%%esi), %%al\n"
  "    inc %%al\n"          //calculate
  "    mov %%al, (%%edi)\n"
  "    inc %%esi\n"
  "    inc %%edi\n"
  "    dec %%ecx\n"
  "    jnz label1\n"        //loop to la
  "    ret\n"
  :
  :"m"(src), "m"(dst), "m"(size)
  :"memory", "esi", "edi", "eax", "ebx", "ecx", "edx"
);

intel2gas's People

Contributors

skywind3000 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.