Difference between revisions of "PUSHV (instruction)"

From Final Fantasy XII Wiki
Jump to navigation Jump to search
(Created page with "{{Instruction|op_name=PUSHV|op_code=0x48|op_size=3|op_args=0|op_desc=Push variable onto stack}} Pushes variable of any type onto stack. 16bit immediate represents a number of...")
 
 
Line 5: Line 5:
 
If pushed variable is declared as an array, additional arguments representing elements are popped from stack. See: [[arrays]].
 
If pushed variable is declared as an array, additional arguments representing elements are popped from stack. See: [[arrays]].
  
{{Clear}}
+
{{Clear}}Typical c-like syntax:<syntaxhighlight lang="cpp">
 +
var1[3] = var2;
 +
</syntaxhighlight>Typical assembler usage:<syntaxhighlight lang="asm">
 +
PUSHV var2
 +
PUSHII 3
 +
POPV var1
 +
</syntaxhighlight><references />

Latest revision as of 21:45, 21 July 2019

PUSHV size: 3
immediate
args: 0
0x48
Push variable onto stack

Pushes variable of any type onto stack. 16bit immediate represents a number of entry in script's variable table[1].

If pushed variable is declared as an array, additional arguments representing elements are popped from stack. See: arrays.

Typical c-like syntax:

var1[3] = var2;

Typical assembler usage:

PUSHV var2
PUSHII 3
POPV var1
  1. For convenience, compiler supports direct variable name usage and converts them into appropriate variable table entry numbers automatically.