245
edits
m (→=Dispatch addresses: -- Fix formatting) |
m (Linkify reference to section) |
||
Line 390: | Line 390: | ||
;<nowiki>op 0x42: callk W kfunct, B kparams (4 bytes)</nowiki> | ;<nowiki>op 0x42: callk W kfunct, B kparams (4 bytes)</nowiki> | ||
;<nowiki>op 0x43: callk B kfunct, B kparams (3 bytes)</nowiki> | ;<nowiki>op 0x43: callk B kfunct, B kparams (3 bytes)</nowiki> | ||
:Call kernel function (see the Kernel functions section) | :Call kernel function (see the [[SCI/Specifications/SCI virtual machine/Kernel functions|Kernel functions]] section) | ||
<syntax type="C"> | <syntax type="C"> | ||
sp -= (kparams + 2 + &rest_modifier); | sp -= (kparams + 2 + &rest_modifier); | ||
Line 418: | Line 418: | ||
</syntax> | </syntax> | ||
:This operation performs a function call (implicitly placing the current program counter on the execution stack) to an ``external'' procedure of a script. More precisely, exported procedure <tt>dispindex</tt> of script <tt>script</tt> is invoked, where <tt>dispindex</tt> is an offset into the script's Exports list (i.e., <tt>dispindex = ''n'' * 2</tt> references the ''n''th exported procedure). | :This operation performs a function call (implicitly placing the current program counter on the execution stack) to an ``external'' procedure of a script. More precisely, exported procedure <tt>dispindex</tt> of script <tt>script</tt> is invoked, where <tt>dispindex</tt> is an offset into the script's Exports list (i.e., <tt>dispindex = ''n'' * 2</tt> references the ''n''th exported procedure). | ||
:The ``Exports list'' is defined in the script's type 7 object (cf. section Script resources). It is an error to invoke a script which does not exist or which does not provide an Exports list, or to use a dispatch index which does not point into an even address within the Exports list. | :The ``Exports list'' is defined in the script's type 7 object (cf. section [[SCI/Specifications/SCI_virtual_machine/Introduction#Script_resources|Script resources). It is an error to invoke a script which does not exist or which does not provide an Exports list, or to use a dispatch index which does not point into an even address within the Exports list. | ||
edits