[Scummvm-devel] Decompiler survey: Variable stack effects

Paul Gilbert paulfgilbert at gmail.com
Sun Jun 13 01:46:59 CEST 2010


On Sat, Jun 12, 2010 at 10:47 PM, Michael Madsen <michael at birdiesoft.dk>wrote:

>
> This brings me to my questions:
> 1) Does your engine have any opcodes that act in a similar way?
> 2) If yes, do you know if this sort of thing is actually used in any
> scripts for your engine?
>

Well, the Tinsel engine is probably one such example. It's stack based, and
one of the fundamental opcodes is 'OP_LIBCALL'. This opcode is basically an
interface to a whole bunch of intrinsic support functions. How many
parameters get popped off the stack (as parameters for each method) depend
on which method is called, which is passed as an immediate parameter along
with the opcode.

There can be many such calls within the one script, so the only way
disassembly could be reasonably handled for this engine, eventually, would
be to have support in the decompiler for special handling for this
instruction to have a lookup table that returns the number of parameters
popped off the stack for each given method Id. At the same time, it might be
useful to be able to replace the immediate value of the method Id with a
descriptive name as well in the resulting disassembly.

Paul.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scummvm.org/pipermail/scummvm-devel/attachments/20100613/64574bdf/attachment.html>


More information about the Scummvm-devel mailing list