Hack64 Wiki
Other Titles
Hack64 Wiki
Other Titles
This is an old revision of the document!
00
Unknown purpose. Sets flag 1 and does not increment the command pointer.
01
Unknown purpose. ASM Summary: Returns 0 in the opcode processing function and does not increment command pointer.
02
Pop offset and context id from the stack, branch to offset and set m_ExecCtx to the context.
Stack: […] [ctxId] [offset] → […]
03 [XX XX]
XXXX=branchOffs
Pop value from the stack. If value is non-zero, branch to immediate offset.
Stack: […] [value] → […]
04 [XX XX]
XXXX=branchOffs
Branch to immediate offset.
05 [XX XX]
XXXX=value
Push immediate value to the stack.
Stack: […] → […] [value]
06 [XX XX]
XXXX=value
Push immediate value to the stack.
Stack: […] → […] [value]
07 [XX XX]
XXXX=varOffset
Push variable from immediate offset to the stack.
Stack: […] → […] [varValue]
08 [XX XX] [YY YY]
XXXX=ctxId, YYYY=varOffset
Push variable from immediate offset in context to the stack.
Stack: […] → […] [varValue]
09 [XX XX]
XXXX=value
Push immediate value to the stack.
Stack: […] → […] [immValue]
0A [XX XX] [YY YY]
XXXX=immValue1, YYYY=immValue2
Push two immediate values to the stack.
Stack: […] → […] [immValue1] [immValue2]
0B
Pop variable id and context id from the stack, push offset of variable to the stack.
Stack: […] [ctxId] [varId] → […] [varOffset]
0C
Pop variable id from the stack, load context id from top of stack (do not pop context id). Push offset of variable to the stack.
Stack: […] [ctxId] [varId] → […] [ctxId] [varOffset]
0D
Pop variable id and context id from the stack. Push context's variable value to the stack.
Stack: […] [ctxId] [varId] → […] [varValue]
0E [XXXX] [YYYY]
Branch to YYYY if (m_UnkA4 == XXXX), else push XXXX to the stack. Stack (if branch is not taken): […] → […] [XXXX]
0F
ASM Summary: if (v2 == 0) call this→func_8006261C(v1), else do nothing.
Stack: […] [v1] [v2] → […]
10
Unknown purpose. Set flag 2.
11
Unknown purpose. Clear flag 2.
12
Stack: […] [value] → [result]
ASM Summary: Pop value from the stack. If (value == m_ExecCtx→GetA4()), push 1, else push 0.
13
Stack: […] [value] [ctxId] → [result]
ASM Summary: Pop value from the stack. If (value == ctx→GetA4()), push 1, else push 0.
14
Pop value from the stack. If (value ⇐ 0), push 1, else push 0.
Stack: […] [value] → [value ⇐ 0]
15
Pop 2 values from the stack, compare (val1 == val2), push 1 if true, 0 if false.
Stack: […] [value2] [value1] → […] [value1 == value2]
16
Pop 2 values from the stack, compare (val1 != val2), push 1 if true, 0 if false.
Stack: […] [value2] [value1] → […] [value1 != value2]
17
Pop 2 values from the stack, if both values are non-zero, push 1, else push 0.
Stack: […] [value2] [value1] → […] [value1 != 0 && value2 != 0]
18
Pop 2 values from the stack, if either value is non-zero, push 1, else push 0.
Stack: […] [value2] [value1] → […] [value1 != 0 || value2 != 0]
19
Pop two values from the stack, subtract second value from the first, push result to the stack.
Stack: […] [value2] [value1] → […] [value1 - value2]
1A
Pop two values from the stack, sum them, push result to the stack.
Stack: […] [value2] [value1] → […] [value1 + value2]
1B
Pop two values from the stack, mod divide second value by the first, push result to the stack.
Stack: […] [value2] [value1] → […] [value2 % value1]
1C
Pop two values from the stack, multiply them, push result to the stack.
Stack: […] [value2] [value1] → […] [value2 * value1]
1D
Pop two values from the stack, divide second value by the first, push result to the stack.
Stack: […] [value2] [value1] → […] [value2 / value1]
1E
Pop two values from the stack, compare (val1 < val2), push 1 to the stack if true, 0 if false.
Stack: […] [value2] [value1] → […] [value1 < value2]
1F
Pop two values from the stack, compare (val1 > val2), push 1 to the stack if true, 0 if false.
Stack: […] [value2] [value1] → […] [value1 < value2]
20
Pop two values from the stack, compare (val1 ⇐ val2), push 1 to the stack if true, 0 if false.
Stack: […] [value2] [value1] → […] [value1 ⇐ value2]
21
Pop two values from the stack, compare (val1 >= val2), push 1 to the stack if true, 0 if false.
Stack: […] [value2] [value1] → […] [value1 >= value2]
22
Pop value from the stack, invert value, push result to the stack.
Stack: […] [value] → […] [-value]
23
Pop two values from the stack, bitwise AND the first value with the second, push result to the stack.
Stack: […] [value2] [value1] → […] [value1 & value2]
24
Pop two values from the stack, bitwise OR them, push result to the stack.
Stack: […] [value2] [value1] → […] [value1 | value2]
25
Pop two values from the stack, bitwise shift first value left by second value, push result to the stack.
Stack: […] [value2] [value1] → […] [value1 « value2]
26
Pop two values from the stack, bitwise shift first value right by second value, push result to the stack.
Stack: […] [value2] [value1] → […] [value1 » value2]
28
Pop variable offset from the stack, copy value from top of stack to variable (do not pop value).
Stack: […] [value] [varOffset] → […] [value]
29
Pop variable offset and context id from the stack, copy value from top of stack to context's variable (do not pop value).
Stack: […] [value] [ctxId] [varOffset] → […] [value]
2A
Pop variable offset from the stack. Increment variable by 1.
Stack: […] [varOffset] → […]
2B
Pop variable offset and context id from the stack. Increment context's variable by 1.
Stack: […] [ctxId] [varOffset] → […]
2C
Pop variable offset from the stack. Decrement variable by 1.
Stack: […] [varOffset] → […]
2D
Pop variable offset and context id from the stack. Decrement context's variable by 1.
Stack: […] [ctxId] [varOffset] → […]
2E
Pop two variable offsets from the stack. Copy value from the first popped variable to the second.
Stack: […] [varOffsetDst] [varOffsetSrc] → […]
2F
Pop variable offset, context id, and value from the stack stack. Add value to context's variable.
Stack: […] [value] [ctxId] [varOffset] → […]
30
Pop variable offset and value from the stack. Subtract value from variable.
Stack: […] [value] [varOffset] → […]
31
Pop variable offset, context id, and value from the stack. Subtract value from context's variable.
Stack: […] [value] [ctxId] [varOffset] → […]
32
Unknown purpose. Clears internal flag 3.
34
Unknown purpose. Sets internal flag 1, clears flag 3.
35
Unknown purpose. Pop context id from the stack and clear context's 0 and 1 flags.
Stack: […] [ctxId] → […]
36
Unknown purpose. Pop context id from the stack and set context's 1 flag.
Stack: […] [ctxId] → […]
37
Unknown purpose.
Stack: […] [value] → […]
ASM Summary: If m_ExecCtx→unkA8 is nonzero after calling m_ExecCtx→func_8006261C(value) clear 3 flag.
38
Unknown purpose.
Stack: […] [value] [ctxId] → […]
ASM Summary: If ctx→unkA8 is nonzero after calling ctx→func_8006261C(value) clear context's 3 flag.
39
Pop method id from the stack. Push opOffs and return offset to the stack. Jump to method offset.
Stack: […] [methodId] → […] [opOffs] [returnOffs]
TODO what is opOffs for?
3A
Pop context id and method id from the stack. Push opOffs and return offset to the stack. Replace m_ExecCtx with context and jump to method offset.
Stack: […] [ctxId] [methodId] → […] [opOffs] [returnOffs]
3B
Pop value from the stack and do nothing with it.
3C
…4A
Call a function with (command byte - 0x3B)
arguments on the stack?
50
…5E
Call a function with (command byte - 0x4F)
arguments on the stack and push the return value to the stack?
27, 33, 4B, 4C, 4D, 4E, 4F, 5F…FF.