[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] TCC code generation for a stack based VM

From: Fabrice Bellard
Subject: Re: [Tinycc-devel] TCC code generation for a stack based VM
Date: Wed, 03 Nov 2004 15:35:58 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.2) Gecko/20040803

Zoltán Lörincz wrote:
Hello Mirar,

thank you again for your answer.

I also thought that it would be easier to generate byte code for a
register based VM.

But then the interpreter, would be slower and more comlicated.

For example for an  i386 style asm code: "mov ax, bx" in the byte code
i should generate
- the opcode for move - then bitfields where i specify that the move is between ax and bx
(in our case)

Decoding this in the interpreter would take more processing time than
in a stack based machine.
 There I don't need to decode anything in this way, only to make a
switch by the opcodes and do the corresponding operations.

Do you have an idea how i could encode/decode the registers/immediate
values, without too much processing time?

The solution was implicit in my previous mail: you must include in the opcode the register numbers. That why I spoke about 9 opcodes per operation if 3 registers are used.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]