flat assembler
Message board for the users of flat assembler.

Index > High Level Languages > Python binding to fasm.dll

Author
Thread Post new topic Reply to topic
Abyx



Joined: 17 Apr 2008
Posts: 9
Abyx 28 Oct 2010, 10:55
Code:
Help on module pyfasm:

NAME
    pyfasm - Python binding for FASM.dll

FILE
    c:\python25\lib\site-packages\pyfasm.py

DESCRIPTION
    Requirements:
        The FASM.dll,
        can be obtained at http://board.flatassembler.net/topic.php?t=6239

        Python 2.5-2.7 or Python 3.x

    Installation:
        Copy this file to \PythonXX\Lib\site-packages\ directory

    Notes:
        To load FASM.dll, PyFASM tries to call LoadLibrary('fasm'),
        LoadLibrary('%FASMPATH%\fasm') and LoadLibrary('%FASM%\fasm').

        Display pipe isn't implemented yet.

        fasm_AssembleFile isn't implemented yet,
        use the following code instead:
            assemble(open('file.asm').read())

    Changelog:
        [2010.10.28] First version

FUNCTIONS
    assemble(src, memorySize=65536, passesLimit=100)
        Assembles string and returns assembled bytes

        >>> src = '''
        ...     jmp @f
        ...     db "123", 10, 0
        ... @@:
        ... '''
        >>> binary = assemble(src)
        >>> import sys
        >>> if sys.version_info[0] == 2:
        ...     ' '.join('%02X' % ord(b) for b in binary)
        ... else:
        ...     ' '.join('%02X' % b for b in binary)
        ...
        'EB 05 31 32 33 0A 00'

    get_version()
        Returns tuple (major version, minor version)

        >>> majorVer, minorVer = get_version()    


Description:
Download
Filename: pyfasm.zip
Filesize: 1.84 KB
Downloaded: 1414 Time(s)

Post 28 Oct 2010, 10:55
View user's profile Send private message Reply with quote
masonswanson



Joined: 17 Aug 2010
Posts: 51
masonswanson 24 Dec 2010, 08:02
This is great thank you so much!
Post 24 Dec 2010, 08:02
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger Reply with quote
abc



Joined: 03 Nov 2009
Posts: 7
Location: Russia
abc 07 Mar 2012, 14:45
thanks Abyx!
good work!

what about make Python to FASM helper converter?
Post 07 Mar 2012, 14:45
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.