This document describes the commands available in the Ovum Intermediate Language (OIL). All commands expect arguments of proper size on the stack and push return value on stack if applicable.
PushInt <value> - Pushes a 64-bit integer literal onto the stackPushFloat <value> - Pushes a 64-bit floating-point literal onto the stackPushBool <value> - Pushes a Boolean literal (true or false) onto the stackPushChar <value> - Pushes a character literal onto the stackPushString <value> - Pushes a string literal onto the stackPushNull - Pushes null onto the stackPop - Removes the top value from the stackDup - Duplicates the top value on the stackSwap - Swaps the top two values on the stackRotate <n> - Rotates the top n values on the stackLoadLocal <index> - Loads a local variable onto the stackSetLocal <index> - Stores the top stack value to a local variableLoadGlobal <name> - Loads a global variable onto the stackSetGlobal <name> - Stores the top stack value to a global variableNewArray <type> <size> - Creates a new array of specified type and sizeArrayLength - Pushes the length of the array (top of stack)ArrayGet - Gets element at index (array, index on stack)ArraySet - Sets element at index (array, index, value on stack)IntAdd - Adds two integers (a + b)IntSubtract - Subtracts two integers (a - b)IntMultiply - Multiplies two integers (a * b)IntDivide - Divides two integers (a / b)IntModulo - Computes remainder (a % b)IntNegate - Negates an integer (-a)IntIncrement - Increments an integer (a + 1)IntDecrement - Decrements an integer (a - 1)FloatAdd - Adds two floats (a + b)FloatSubtract - Subtracts two floats (a - b)FloatMultiply - Multiplies two floats (a * b)FloatDivide - Divides two floats (a / b)FloatNegate - Negates a float (-a)FloatSqrt - Computes square root (sqrt(a)). NaN if negative.ByteAdd - Adds two bytes (a + b)ByteSubtract - Subtracts two bytes (a - b)ByteMultiply - Multiplies two bytes (a * b)ByteDivide - Divides two bytes (a / b)ByteModulo - Computes remainder (a % b)ByteNegate - Negates a byte (-a)ByteIncrement - Increments a byte (a + 1)ByteDecrement - Decrements a byte (a - 1)IntEqual - Tests integer equality (a == b)IntNotEqual - Tests integer inequality (a != b)IntLessThan - Tests integer less than (a < b)IntLessEqual - Tests integer less than or equal (a <= b)IntGreaterThan - Tests integer greater than (a > b)IntGreaterEqual - Tests integer greater than or equal (a >= b)FloatEqual - Tests float equality (a == b)FloatNotEqual - Tests float inequality (a != b)FloatLessThan - Tests float less than (a < b)FloatLessEqual - Tests float less than or equal (a <= b)FloatGreaterThan - Tests float greater than (a > b)FloatGreaterEqual - Tests float greater than or equal (a >= b)ByteEqual - Tests byte equality (a == b)ByteNotEqual - Tests byte inequality (a != b)ByteLessThan - Tests byte less than (a < b)ByteLessEqual - Tests byte less than or equal (a <= b)ByteGreaterThan - Tests byte greater than (a > b)ByteGreaterEqual - Tests byte greater than or equal (a >= b)BoolAnd - Logical AND (a && b)| BoolOr- Logical OR (a | b) | 
BoolNot - Logical NOT (!a)BoolXor - Logical XOR (a ^ b)IntAnd - Bitwise AND (a & b)| IntOr- Bitwise OR (a | b) | 
IntXor - Bitwise XOR (a ^ b)IntNot - Bitwise NOT (~a)IntLeftShift - Left bit shift (a « b)IntRightShift - Right bit shift (a » b)ByteAnd - Bitwise AND (a & b)| ByteOr- Bitwise OR (a | b) | 
ByteXor - Bitwise XOR (a ^ b)ByteNot - Bitwise NOT (~a)ByteLeftShift - Left bit shift (a « b)ByteRightShift - Right bit shift (a » b)StringConcat - Concatenates two strings (a + b)StringLength - Gets string lengthStringSubstring - Extracts substring (string, start, length on stack)StringCompare - Compares two strings lexicographicallyStringToInt - Converts string to integerStringToFloat - Converts string to floatIntToString - Converts integer to stringFloatToString - Converts float to stringCall <function> - Calls a functionCallIndirect - Calls function at address on stackCallVirtual <methodName> - Calls virtual method using vtable dispatch by method name.Return - Returns from current functionGetField <name> - Gets object field (object on stack)SetField <name> - Sets object field (object, value on stack)CallConstructor <class> - Calls object constructor (arguments on stack)Unwrap <class> - Unwraps value from primitive to fundamentalGetVTable <class> - Gets vtable for specified classSetVTable <class> - Sets vtable for object instanceIsNull - Tests if top of stack is nullIsNotNull - Tests if top of stack is not nullSafeCall <method> - Safe method call on nullable objectNullCoalesce - Null coalescing operator (a ?? b)Unwrap - Unwraps nullable valuePrint - Prints string to standard outputPrintLine - Prints string followed by newlineReadLine - Reads line from standard inputReadChar - Reads single character from standard inputUnixTime - Gets current Unix timestampUnixTimeMs - Gets current Unix timestamp in millisecondsUnixTimeNs - Gets current Unix timestamp in nanosecondsNanoTime - Gets high-resolution monotonic timeFormatDateTime - Formats timestamp using format stringParseDateTime - Parses date string to timestampOpenFile - Opens file with specified modeCloseFile - Closes fileFileExists - Checks if file existsDirectoryExists - Checks if directory existsCreateDirectory - Creates directoryDeleteFile - Deletes fileDeleteDirectory - Deletes directoryMoveFile - Moves/renames fileCopyFile - Copies fileListDirectory - Lists directory contentsGetCurrentDirectory - Gets current working directoryChangeDirectory - Changes current directorySleepMs - Sleeps for specified millisecondsSleepNs - Sleeps for specified nanosecondsExit - Terminates process with exit codeGetProcessId - Gets current process IDGetEnvironmentVariable - Gets environment variableSetEnvironmentVariable - Sets environment variableRandom - Generates random 64-bit integerRandomRange - Generates random integer in rangeRandomFloat - Generates random float [0.0, 1.0)RandomFloatRange - Generates random float in rangeSeedRandom - Seeds random number generatorGetMemoryUsage - Gets current memory usageGetPeakMemoryUsage - Gets peak memory usageForceGarbageCollection - Forces garbage collectionGetProcessorCount - Gets number of CPU coresGetOsName - Gets operating system nameGetOsVersion - Gets operating system versionGetArchitecture - Gets CPU architectureGetUserName - Gets current usernameGetHomeDirectory - Gets user’s home directoryGetLastError - Gets last system error descriptionClearError - Clears last error stateInterope - Calls external function via FFI (unsafe)TypeOf - Gets type of value on stackIsType <type> - Tests if value is of specific typeSizeOf <type> - Gets size of type in bytes