Difference between revisions of "Arrays"

From Final Fantasy XII Wiki
Jump to navigation Jump to search
(Created page with "Virtual Machine supports either one or two dimensional arrays. Each variable type can be declared as an array. Accessing indexes is done by pushing values to the stack. So for...")
 
Line 3: Line 3:
 
<code>int array[2][3];</code> accessing element <code>array[0][1]</code> is done by performing operations:
 
<code>int array[2][3];</code> accessing element <code>array[0][1]</code> is done by performing operations:
  
<code>PUSHII 0</code>
+
<pre>PUSHII 0
 +
PUSHII 1
 +
PUSHV [array]</pre>
  
<code>PUSHII 1</code>
+
where <code>[array]</code> is number of variable array in variable table.
 
 
<code>PUSHV [array]</code>
 
 
 
where [array] is number of variable array in variable table.
 

Revision as of 13:54, 15 July 2019

Virtual Machine supports either one or two dimensional arrays. Each variable type can be declared as an array. Accessing indexes is done by pushing values to the stack. So for an array:

int array[2][3]; accessing element array[0][1] is done by performing operations:

PUSHII 0
PUSHII 1
PUSHV [array]

where [array] is number of variable array in variable table.