pyasm 0.2 - dynamic x86 assembler for python

Stefan Behnel stefan.behnel-n05pAM at
Thu Mar 10 15:01:41 CET 2005


What about an interface like this:

def hello_world(*some_args):
      !CHARS hello_str 'Hello world!\n\0'

      !PROC hello_world PYTHON
      !ARG  self
      !ARG  args

           PUSH hello_str
           CALL PySys_WriteStdout
           ADD ESP, 0x4
           MOV EAX,PyNone
           ADD [EAX],1


Meaning: Put the assembler into the doc-string of a function. Then use a
decorator to run the assembler on the function's __doc__ string and build an
assembly function that takes the same arguments to make the assembly function
directly callable.

Maybe the decorator line has to look like this:
or something like that, I can't tell. I don't think it would be much work to 
implement this.


More information about the Python-list mailing list