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 stackPushByte <value> - Pushes a byte literal onto the stackPushString <value> - Pushes a string literal onto the stackPushNull - Pushes null into a nullable wrapper 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 variableLoadStatic <index> - Loads a static variable onto the stackSetStatic <index> - Stores the top stack value to a static variableIntAdd - 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 stringIntToFloat - Converts integer to floatFloatToInt - Converts float to integerByteToInt - Converts byte to integerCharToByte - Converts character to byteByteToChar - Converts byte to characterBoolToByte - Converts bool to byteCall <function> - Calls a functionCallIndirect - Calls function at address on stackCallVirtual <method> - Calls virtual method using vtable dispatch by method name (without class name).Return - Returns from current functionGetField <number> - Gets object field by index in vartable (object on stack)SetField <number> - Sets object field by index in vartable (object, value on stack)CallConstructor <constructor> - Calls object constructor (arguments on stack except this)Unwrap - Unwraps the first field of the object (including nullable and primitive reference types)GetVTable <class> - Gets vtable for specified classSetVTable <class> - Sets vtable for object instanceSafeCall <method> - Safe method call on nullable objectNullCoalesce - Null coalescing operator (a ?: b from stack)IsNull - Tests if top of stack is a wrapper that contains nullPrint - Prints string to standard outputPrintLine - Prints string followed by newlineReadLine - Reads line from standard inputReadChar - Reads single character from standard inputReadInt - Reads integer from standard inputReadFloat - Reads float 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 timestampFileExists - 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 stateInterop - Calls external function via FFI (unsafe)TypeOf - Gets type name of value on stackIsType <type> - Tests if value is of specific type or interfaceSizeOf <type> - Gets size of type in bytes