[kaffe] [PATCH] Add support for AMD64

Dalibor Topic robilad at yahoo.com
Tue May 20 07:02:01 PDT 2003

Salut Gwenole,

--- Gwenole Beauchesne <gbeauchesne at mandrakesoft.com> wrote:
> On Mon, 19 May 2003, Dalibor Topic wrote:
> > > I planned to port JIT3 too by I hadn't got enough time recently to do so.
> > > A few months ago, I implemented a run-time assembler though. It can
> handle 
> > > both IA-32 and AMD64 architectures with REX prefixes, SSE/SSE2 
> > > instructions.
> > 
> > I'm confused. What is a run-time assembler?
> An assembler included in your program to assemble instructions at
> execution time (run-time). e.g. you write things like:
>   MOVBrr(X86_BL, X86_DL);
>   MOVLmr(0, X86_NOREG, X86_RAX, 1, X86_EAX);
> and you get the resulting opcodes in your buffer. This disassembles to:
> 00000227: 88 da                 mov    %bl,%dl
> 00000229: 8b 04 05 00 00 00 8b  mov    0x0(,%rax,1),%eax
> Otherwise, it's difficult to maintain if you hand-assemble things, and 
> this actually can be reused for other projects. ;-)

I see, I've browsed around a bit and turned up a few more runtime assemblers:

(pentium, translates text at runtime into assembly)

(powerpc, sparc, pentium, translates C source code with assembler bits thrown
in at compile time into pure ANSI C. They have an example dynamic translator as

(mips, sparc, ... cross platform toolkit for dynamic code translation)

So what's the benefit of using a runtime-assembler? Cross-project jitters
(Basilisk II & kaffe ;)? That would be nice ...

dalibor topic

Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.

More information about the kaffe mailing list