Difference between revisions of "General Vritual Machine architecture"

From Final Fantasy XII Wiki
Jump to navigation Jump to search
Line 1: Line 1:
 
{| class="wikitable" style="float:right; margin-left: 10px;"
 
{| class="wikitable" style="float:right; margin-left: 10px;"
 
|+VM's general specifications
 
|+VM's general specifications
!style="text-align:left;" |Type
+
! style="text-align:left;" |Type
|style="text-align:right;" |stack based
+
| style="text-align:right;" |stack based
 
|-
 
|-
!style="text-align:left;" |Integer registers
+
! style="text-align:left;" |Integer registers
|style="text-align:right;" |4 (I0 to I3)
+
| style="text-align:right;" |4 (I0 to I3)
 
|-
 
|-
!style="text-align:left;" |Float registers
+
! style="text-align:left;" |Float registers
|style="text-align:right;" |4 (F0 to F3)
+
| style="text-align:right;" |4 (F0 to F3)
 
|-
 
|-
!style="text-align:left;" |Special registers
+
! style="text-align:left;" |Special registers
|style="text-align:right;" |3 (X, Y, A)
+
| style="text-align:right;" |3 (X, Y, A)
 
|-
 
|-
!style="text-align:left;" |Number of instructions
+
! style="text-align:left;" |Number of instructions
|style="text-align:right;" |100
+
| style="text-align:right;" |100
 
|-
 
|-
!style="text-align:left;" |Maximum stack size
+
! style="text-align:left;" |Maximum stack size
|style="text-align:right;" |unknown
+
| style="text-align:right;" |unknown
 +
|-
 +
!Number of calls
 +
|~2000
 
|}
 
|}
 
Final Fantasy XII contains a stack based '''virtual machine''' that runs field and event scripts. The implementation seems to be exactly the same starting with Japanese PS2 release, through PS4, PC and Nintendo Switch versions. The only thing that changes are available calls. Each subsequent version supports all previous calls and includes a few dozen of new ones at most.
 
Final Fantasy XII contains a stack based '''virtual machine''' that runs field and event scripts. The implementation seems to be exactly the same starting with Japanese PS2 release, through PS4, PC and Nintendo Switch versions. The only thing that changes are available calls. Each subsequent version supports all previous calls and includes a few dozen of new ones at most.
  
  
General VM specifications are as follows:
+
Even though the VM contains a set of registers, they are used either by compiler or have only quality of life purpose (so it is not needed to declare variables for iterators or temporary storage). All except a few instructions operate solely on stack.

Revision as of 09:26, 15 July 2019

VM's general specifications
Type stack based
Integer registers 4 (I0 to I3)
Float registers 4 (F0 to F3)
Special registers 3 (X, Y, A)
Number of instructions 100
Maximum stack size unknown
Number of calls ~2000

Final Fantasy XII contains a stack based virtual machine that runs field and event scripts. The implementation seems to be exactly the same starting with Japanese PS2 release, through PS4, PC and Nintendo Switch versions. The only thing that changes are available calls. Each subsequent version supports all previous calls and includes a few dozen of new ones at most.


Even though the VM contains a set of registers, they are used either by compiler or have only quality of life purpose (so it is not needed to declare variables for iterators or temporary storage). All except a few instructions operate solely on stack.