Wrapper round x86 Assembler

John Roth newsgroups at jhrothjr.com
Sat Apr 10 10:20:51 EDT 2004


"Fuzzyman" <michael at foord.net> wrote in message
news:8089854e.0404082353.7bf163a2 at posting.google.com...
> There might be a really good reason why this hasn't been done *or*
> someone might have done it and I just can't find it..... *but*
>
> what about a wrapper to an assembler (presumably for x86 assembly !)
> !!
> I just wrote some code doing binary operations which would have been
> about a zillion times faster in a few lines of assembly code.
>
> I also have fond memories of programming in BBC Basic which had an
> inline assembler - so you could wrap your assembly program in Basic.
> It meant some commercial games started with Basic !
>
> Anyway - it would be easy to reserve some memory with a string like
> object to pass to an 'assembly object' and allow some really nifty
> (and fast) stuff ?? For simple algorithms it would be very neat.
> Avoiding memory overflow etc would be up to the assembly code 'chunk'
> of course.
>
> Regards,
>
>
> Fuzzy

You should be able to write a relatively simple C language extension
that would let you do this. The interface to extensions isn't all that
hard to work with. It would probably be pretty useful for some kinds
of intensive crunching. There's one thing to watch out for: Intel
CPU's are going to a model where dynamically generated code won't
work unless you provide the correct incantation. This is to eliminate a
large class of viri.

John Roth





More information about the Python-list mailing list