Using my asm-generator with Exypery.

bryce at kampjes.demon.co.uk bryce at kampjes.demon.co.uk
Tue May 8 19:48:42 UTC 2007


sig writes:
 > On 09/05/07, Guillermo Adrián Molina <guille at losmolina.com.ar> wrote:
 > There are assembler instructions which currently not supported by
 > Exupery, so it may be problematic to get fully equivalent code in asm
 > for some primitives.
 > For instance, mov instructions support only 32 mem/reg operand size.
 > Also, NOT, XOR is missing (without these instruction i can't invert
 > operand, because logical set of instructions is not fully defined. If
 > there will be NOT, i can use it to do XOR, if there will be XOR i can
 > do NOT, but i cannot invert without at least one of them).
 > I would also like to see support of calls with relative offset, so i
 > can link all compiled functions in single byte array and properly set
 > relative calls where its needed.

If you want to add the missing instructions feel free, I'll merge
them into Exupery so long as they're written in a similar style and
have similar test coverage.

 > I found only one way how to load a compiled code into executable
 > memory: its a 'loadCode' primitive.
 > It loads a given bytearray to code cache and returns a pointer to it.
 > The problem is, that i don't see a way how i can modify bytes in
 > already loaded chunk of code (for relocating calls).
 > 
 > BAH! I just thought, that problem can be simply solved by loading at
 > startup a small asm subroutine which will allow me to do that :)
 > simple assembly function accepting 2 arguments - pointer and value.. :)
 > See, how life can be easier: i have a way for extending functionality
 > based on what i have! I don't need to climb down to C and write
 > another plugin/primitive :)

Have a look at Exupery>>relocateMethodAt:

Exupery does relocation after loading code. 

 > > What is the state of your project? (unfinished, testing, etc)
 > 
 > Current state is unfinished. I must polish some things and add extra
 > functionality.
 > Parser is functional (at least by my analysis it generates correct
 > intermediate for given methods). To test it in action i'll need to
 > install exupery plugin. Btw, if someone can share a ready to use
 > squeak win32 executable with it, things will go faster..

There's both a Windows and a Linux VM here:

http://wiki.squeak.org/squeak/3945

Bryce


More information about the Exupery mailing list