<div class="gmail_quote">On Sat, Jun 12, 2010 at 10:47 PM, Michael Madsen <span dir="ltr"><<a href="mailto:michael@birdiesoft.dk">michael@birdiesoft.dk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
This brings me to my questions:<br>
1) Does your engine have any opcodes that act in a similar way?<br>
2) If yes, do you know if this sort of thing is actually used in any scripts for your engine?<br></blockquote><div><br></div></div>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.<br>
<br>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.<br>
<br>Paul.<br>