Git Product home page Git Product logo

asm2c's People

Contributors

frranck avatar simpletease avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

asm2c's Issues

Can this work on the CRT asm files?

I would like to have some program on my 64 bit Windows 7 that takes the current C Runtime Library files that has ASM implementations and get a version in C so I can understand them more (I dont fully get ASM).

Here is an example ASM Code from the CRT that is some stack checking that I need in C:

        page    ,132
        title   chkstk - C stack checking routine

.xlist
        include vcruntime.inc
.list

; size of a page of memory

_PAGESIZE_      equ     1000h


        CODESEG

page

public  _alloca_probe

_chkstk proc

_alloca_probe    =  _chkstk

        push    ecx

; Calculate new TOS.

        lea     ecx, [esp] + 8 - 4      ; TOS before entering function + size for ret value
        sub     ecx, eax                ; new TOS

; Handle allocation size that results in wraparound.
; Wraparound will result in StackOverflow exception.

        sbb     eax, eax                ; 0 if CF==0, ~0 if CF==1
        not     eax                     ; ~0 if TOS did not wrapped around, 0 otherwise
        and     ecx, eax                ; set to 0 if wraparound

        mov     eax, esp                ; current TOS
        and     eax, not ( _PAGESIZE_ - 1) ; Round down to current page boundary

cs10:
        cmp     ecx, eax                ; Is new TOS
    bnd jb      short cs20              ; in probed page?
        mov     eax, ecx                ; yes.
        pop     ecx
        xchg    esp, eax                ; update esp
        mov     eax, dword ptr [eax]    ; get return address
        mov     dword ptr [esp], eax    ; and put it at new TOS
    bnd ret

; Find next lower page and probe
cs20:
        sub     eax, _PAGESIZE_         ; decrease by PAGESIZE
        test    dword ptr [eax],eax     ; probe page.
        jmp     short cs10

_chkstk endp

        end

So would this work on ASM code like this for my needs?

Swift compile problems

swift build

Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
Target: x86_64-apple-darwin19.5.0
Fetching https://github.com/crossroadlabs/Regex.git
Fetching https://github.com/frranck/Expression
error: because no versions of Expression match the requirement 0.13.2..<1.0.0 and root depends on Expression 0.13.2..<1.0.0, version solving failed.
'asm2c' /Users/appveyor/projects/asm2c: error: Source files for target asm2cTests should be located under 'Tests/asm2cTests', or a custom sources path can be set with the 'path' property in Package.swift

???

Convert Go/Golang based "Assembly" into C

Hi,
( i have Starred this project).
as far as i understand this tool can handle upto 32bit x86 code ?
can/does it also support AMD64 based Assembly into ANSI C ?

i need to convert "Go" into "C" , or "Go" into "C++" , i have posted some solutions here (in SO) & mentioned this project there too , & also here . Please upvote my Q+A both in SO (or vote "Converting/transpiling..." topic here to Undelete), if you want to . ( Google Crimes1, 2, 3, 4, 5, 6. Problems in "Go"1, 2, 3, 4, 5, 6, 7. )

Output of below commands are in "Main.s" file , which has Golang/Google based"Assembly" , not general/standard or GNU/GAS-Assembly, not NASM-Assembly.
cmd: go tool compile -S Main.go
 or
cmd: go build -gcflags -S Main.go

can this "asm2c" tool produce ANSI C output from Go-Assembly ?
if not, would you please add such option/feature ?
or, what would you suggest i should use ?

EDIT : added a sentence on upvoting in SO.
EDIT : added links for 'Go'-problems.
EDIT : added a link to new Transpiler-List project site, etc.

instrcutions tests

I'm developing similar project using Python (masm2c) because I don't know Swift.
I have ported i386 instructions tests from qemu.
You can reuse it too:
_qemu_tests.zip
It can be run directly on hardware or translated using masm2c. So you can compare output of instructions (regs and flags) and make sure all instructions calculate well as hardware.

[REQ] Working with Impulse Tracker?

Don't know how much of the classic Impulse Tracker would be handled successfully by asm2c, but would sure love to find out! I'm unable to use the Mac xcodeproj, is the source OS-independent otherwise or does it require Mac-specific APIs?

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.