Wrapper round x86 Assembler

Fuzzyman michael at foord.net
Wed Apr 14 03:23:09 EDT 2004


Peter Hansen <peter at engcorp.com> wrote in message news:<R9-dnUYH8r32f-bd4p2dnA at powergate.ca>...
> Fuzzyman wrote:
> 
> > Right ? I got confused by the mention that they could handle inline
> > assembler.... so many of the compilers include an assembler as well...
> > purely for 'inline assembly'.... ??
> 
> That's correct.  Of course, many also do the CC+AS thing, but
> I think that's no longer the most common approach.
> 
> > My past experience of assembly was using an operating system that
> > handled multitasking 'behind the scenes' (pre-emptive multitasking) -
> > so there was no performance hit on the rest of your system from
> > writing crappy assembly - and the internal architecture of the
> > processor was useful enough to make coding fun.....
> 
> The 68K was certainly assembly-friendly, compared to anything
> yet produced by Intel. :-)
> 
> > It does occur to me that for a certain subset of a 'pseudo assembly
> > language' a 'cross-platform assembler' could work 
> 
> I really think that in most ways that matter (not quite all, but most)
> this is exactly what C was designed to be and is.  It is only a very
> thin layer on top of assembly, really.  You can think of it is a
> pseudo-high-level language designed to allow assembly programmers to
> write code roughly the way they would if they were not just hacking.
> The Amiga's huge variety of STRUCT macros, for example, are
> practically field-for-field identical to how C structs work, mostly
> just providing an efficient method for specifying the offsets of
> each field.  Pointers are nothing more than a more concise way of
> expressing the "indirect" addressing mode.  Heck, C even has (or had)
> the "goto" statement and labels!  And the for loop syntax is basically
> just how assembly loops are done, but again in a more concise and
> readable fashion.
> 
> I think anyone who attempted to do a "cross-platform assembler"
> would quickly find themselves heading in the direction of something
> like C.  (I know such things have actually been attempted, and even
> exist, by the way.  They just aren't mainstream and clearly C has
> greater success.)  Any attempt to stay at the level of hardware
> registers would immediately prevent the term "cross-platform" from
> applying.
> 
> -Peter

In summary - I'm better off learning C and how to write Python
extensions !!
It's just a very 'undynamic solution'.

Ho hum.... I've been trying to avoid delving into the arcane
makefile/linker/compiler chain mysteries... probably be more useful
anyway.

I will be using MinGw and gcc I think.... great fun - any suggestions
of good resources to start learning :
a) The mechanics and plumbing of using MinGw to compile for the win32
platform (building makefiles, system configuration etc)
b) learning C

I'm 'aware' of the concepts of memory allocation, garbage collection
etc - but I'm sure there's plenty more to learn..........

Regards,


Fuzzy

http://www.voidspace.org.uk/atlantibots/pythonutils.html



More information about the Python-list mailing list