InstructionSet.sleela
lib/vm/InstructionSet.sleela · 520 line(s) · sleela
#sleela 2.5
material;
< Source-side canonical SLeeLa VM ISA registry. Numeric order is canonical. >
< Canonical opcode order follows the native enum exactly. >
< Runtime services (networking, files, sockets, threading, GC, cancellation, ownership, and teardown) are specified in /lib/vm/RUNTIME-SERVICES.md. GC is a runtime mechanism, not a hidden opcode. >
<< Runtime support: all canonical entries are dispatched by /impl/core. Unknown values are rejected and logged.
(0..123 canonical; 124 OP_GC_HINT, 125 OP_RAN_MEM; 126..147 OP_IC_* idea-canvas;
148 OP_VM_SELECT; 149 OP_MODIUM_SCAN; 150 OP_UI_CALL; 151 OP_SSEND;
152 OP_CHECKCAST; 153 OP_INSTANCEOF; 154 OP_DUP2; 155 OP_OSLS_CALL;
156..178 append-only math/native/Java-string/exception extensions;
179..181 reserved Native IPC worker instructions; 182 OP_REF object references;
183..194 append-only UTF-16, bitwise, char, and multidimensional-array extensions.
195 OP_MATH_CALL scalar native math; 196..281 are reserved math-family ranges:
196..199 shared native math; 200..207 Vector; 208..215 Matrix;
216..223 Complex; 224..231 Decomposition; 232..281 Transform.) >>
< Operating-system system calls (OP_OS_*, syntax 1.5) are a runtime-service family like sockets/files: a spawned process is a VM-local bounded handle. See /lib/vm/RUNTIME-SERVICES.md and /lib/operating-system/OS.md. >
< OP_NOP >
< OP_CONST >
< OP_POP >
< OP_DUP >
< OP_LOADG >
< OP_STOREG >
< OP_LOADL >
< OP_STOREL >
< OP_ADD >
< OP_SUB >
< OP_MUL >
< OP_DIV >
< OP_MOD >
< OP_NEG >
< OP_EQ >
< OP_NE >
< OP_LT >
< OP_LE >
< OP_GT >
< OP_GE >
< OP_AND >
< OP_OR >
< OP_NOT >
< OP_JMP >
< OP_JMPF >
< OP_CALL >
< OP_RET >
< OP_PRINT >
< OP_SPAWN >
< OP_JOINALL >
< OP_LOCK >
< OP_UNLOCK >
< OP_SEND >
< OP_RECV >
< OP_LISTEN >
< OP_ACCEPT >
< OP_CONNECT >
< OP_SOCKREAD >
< OP_SOCKWRITE >
< OP_SOCKCLOSE >
< OP_PIPE >
< OP_PIPEPEER >
< OP_FIFO_MK >
< OP_FILEOPEN >
< OP_FILEREAD >
< OP_FILEWRITE >
< OP_FILECLOSE >
< OP_FILEUNLINK >
< OP_HALT >
< OP_TIME_UTC_MS >
< OP_TIME_UTC_NS >
< OP_TIME_MONO_NS >
< OP_TIME_PRECISION_MS >
< OP_TIME_LOCATION >
< OP_TIME_HTTP_DATE >
< OP_TIME_JSON >
< OP_TIME_NTP >
< OP_TIME_SET_LOCATION >
< OP_NEWSTRUCT >
< OP_GETFIELD >
< OP_SETFIELD >
< OP_STRUCTPACK >
< OP_STRUCTUNPACK >
< OP_SYN_OPEN >
< OP_SYN_DISPATCH >
< OP_SYN_STAT >
< OP_SYN_REPORT >
< OP_SYN_CLOSE >
< OP_MUN_START >
< OP_MUN_CONNECT >
< OP_MUN_ENABLE >
< OP_MUN_SEND >
< OP_MUN_THATCH >
< OP_MUN_CONSUME >
< OP_MUN_LATCH >
< OP_MUN_RECEPTION >
< OP_MUN_CLOSE >
< OP_BEST_NEW >
< OP_BEST_WEIGHT >
< OP_BEST_MINVER >
< OP_BEST_BUDGET >
< OP_BEST_CAND >
< OP_BEST_RECORD >
< OP_BEST_SCORE >
< OP_BEST_BEST >
< OP_BEST_STAT >
< OP_BEST_CHOICE >
< OP_BEST_REPORT >
< OP_BEST_ARCH >
< OP_BEST_ARCH_STATE >
< OP_BEST_CLOSE >
< OP_AUDIO_NEW >
< OP_AUDIO_ADD >
< OP_AUDIO_CONTROLS >
< OP_AUDIO_VALIDATE >
< OP_AUDIO_RENDER >
< OP_AUDIO_CLOSE >
< OP_AUDIO_PLATFORM >
< OP_NEWARRAY >
< OP_ARRGET >
< OP_ARRSET >
< OP_ARRLEN >
< OP_ARRPUSH >
< OP_OS_PLATFORM >
< OP_OS_CAPABILITY >
< OP_OS_GETENV >
< OP_OS_SETENV >
< OP_OS_CWD >
< OP_OS_CHDIR >
< OP_OS_HOSTNAME >
< OP_OS_USERNAME >
< OP_OS_TEMPDIR >
< OP_OS_PID >
< OP_OS_EXISTS >
< OP_OS_ISDIR >
< OP_OS_FILESIZE >
< OP_OS_MKDIR >
< OP_OS_REMOVE >
< OP_OS_RENAME >
< OP_OS_RUN >
< OP_OS_SPAWN >
< OP_OS_WAIT >
< OP_OS_KILL >
< OP_OS_PCLOSE >
< OP_GC_HINT >
< OP_RAN_MEM >
class SLISANop {
< ---- Descriptive metadata (version 1.11 nested-friendly accessors) ---- >
<< Eleven catalogued attributes with getter/setter pairs, so a GUI, loader,
or catalog can read and (where appropriate) override this record.
Values are faithful to the subject's real origin where publicly known. >>
String metaVersion = "1.0.0";
int metaId = 10036;
String metaAuthor = "Max Rupplin vs. Dr. Mrs. Elisabeth Harkins";
String metaDate = "2026-10-16";
String metaCopyright = "SLeeLa project";
String metaTrademark = "none";
String metaCorporation = "none";
< metaOrigin: National | <nation> | International | Galactic >
String metaOrigin = "International";
String metaBirthDate = "2026-10-02";
< metaScienceRating: maturity/robustness on a 1..10 scale >
int metaScienceRating = 9;
< metaNationalSchedule: a real, citable instrument or "none" >
String metaNationalSchedule = "none";
String getMetaVersion() { return metaVersion; }
void setMetaVersion(String v) { metaVersion = v; }
int getMetaId() { return metaId; }
void setMetaId(int v) { metaId = v; }
String getAuthor() { return metaAuthor; }
void setAuthor(String v) { metaAuthor = v; }
String getDate() { return metaDate; }
void setDate(String v) { metaDate = v; }
String getCopyright() { return metaCopyright; }
void setCopyright(String v) { metaCopyright = v; }
String getTrademark() { return metaTrademark; }
void setTrademark(String v) { metaTrademark = v; }
String getCorporation() { return metaCorporation; }
void setCorporation(String v) { metaCorporation = v; }
String getOrigin() { return metaOrigin; }
void setOrigin(String v) { metaOrigin = v; }
String getBirthDate() { return metaBirthDate; }
void setBirthDate(String v) { metaBirthDate = v; }
int getScienceRating() { return metaScienceRating; }
void setScienceRating(int v) { metaScienceRating = v; }
String getNationalSchedule() { return metaNationalSchedule; }
void setNationalSchedule(String v) { metaNationalSchedule = v; } String name; int code; }
class SLISAConst { String name; int code; }
class SLISAPop { String name; int code; }
class SLISADup { String name; int code; }
class SLISALoadG { String name; int code; }
class SLISAStoreG { String name; int code; }
class SLISALoadL { String name; int code; }
class SLISAStoreL { String name; int code; }
class SLISAAdd { String name; int code; }
class SLISASub { String name; int code; }
class SLISAMul { String name; int code; }
class SLISADiv { String name; int code; }
class SLISAMod { String name; int code; }
class SLISANeg { String name; int code; }
class SLISAEq { String name; int code; }
class SLISANe { String name; int code; }
class SLISALt { String name; int code; }
class SLISALe { String name; int code; }
class SLISAGt { String name; int code; }
class SLISAGe { String name; int code; }
class SLISAAnd { String name; int code; }
class SLISAOr { String name; int code; }
class SLISANot { String name; int code; }
class SLISAJmp { String name; int code; }
class SLISAJmpF { String name; int code; }
class SLISACall { String name; int code; }
class SLISARet { String name; int code; }
class SLISAPrint { String name; int code; }
class SLISASpawn { String name; int code; }
class SLISAJoinAll { String name; int code; }
class SLISALock { String name; int code; }
class SLISAUnlock { String name; int code; }
class SLISASend { String name; int code; }
class SLISARecv { String name; int code; }
class SLISAListen { String name; int code; }
class SLISAAccept { String name; int code; }
class SLISAConnect { String name; int code; }
class SLISASockRead { String name; int code; }
class SLISASockWrite { String name; int code; }
class SLISASockClose { String name; int code; }
class SLISAPipe { String name; int code; }
class SLISAPipePeer { String name; int code; }
class SLISAFifoMk { String name; int code; }
class SLISAFileOpen { String name; int code; }
class SLISAFileRead { String name; int code; }
class SLISAFileWrite { String name; int code; }
class SLISAFileClose { String name; int code; }
class SLISAFileUnlink { String name; int code; }
class SLISAHalt { String name; int code; }
class SLISATimeUtcMs { String name; int code; }
class SLISATimeUtcNs { String name; int code; }
class SLISATimeMonoNs { String name; int code; }
class SLISATimePrecisionMs { String name; int code; }
class SLISATimeLocation { String name; int code; }
class SLISATimeHttpDate { String name; int code; }
class SLISATimeJson { String name; int code; }
class SLISATimeNtp { String name; int code; }
class SLISATimeSetLocation { String name; int code; }
class SLISANewStruct { String name; int code; }
class SLISAGetField { String name; int code; }
class SLISASetField { String name; int code; }
class SLISAStructPack { String name; int code; }
class SLISAStructUnpack { String name; int code; }
class SLISASynOpen { String name; int code; }
class SLISASynDispatch { String name; int code; }
class SLISASynStat { String name; int code; }
class SLISASynReport { String name; int code; }
class SLISASynClose { String name; int code; }
class SLISAMunStart { String name; int code; }
class SLISAMunConnect { String name; int code; }
class SLISAMunEnable { String name; int code; }
class SLISAMunSend { String name; int code; }
class SLISAMunThatch { String name; int code; }
class SLISAMunConsume { String name; int code; }
class SLISAMunLatch { String name; int code; }
class SLISAMunReception { String name; int code; }
class SLISAMunClose { String name; int code; }
class SLISABestNew { String name; int code; }
class SLISABestWeight { String name; int code; }
class SLISABestMinver { String name; int code; }
class SLISABestBudget { String name; int code; }
class SLISABestCand { String name; int code; }
class SLISABestRecord { String name; int code; }
class SLISABestScore { String name; int code; }
class SLISABestBest { String name; int code; }
class SLISABestStat { String name; int code; }
class SLISABestChoice { String name; int code; }
class SLISABestReport { String name; int code; }
class SLISABestArch { String name; int code; }
class SLISABestArchState { String name; int code; }
class SLISABestClose { String name; int code; }
class SLISAAudioNew { String name; int code; }
class SLISAAudioAdd { String name; int code; }
class SLISAAudioControls { String name; int code; }
class SLISAAudioValidate { String name; int code; }
class SLISAAudioRender { String name; int code; }
class SLISAAudioClose { String name; int code; }
class SLISAAudioPlatform { String name; int code; }
class SLISANewArray { String name; int code; }
class SLISAArrGet { String name; int code; }
class SLISAArrSet { String name; int code; }
class SLISAArrLen { String name; int code; }
class SLISAArrPush { String name; int code; }
class SLISAOsPlatform { String name; int code; }
class SLISAOsCapability { String name; int code; }
class SLISAOsGetEnv { String name; int code; }
class SLISAOsSetEnv { String name; int code; }
class SLISAOsCwd { String name; int code; }
class SLISAOsChdir { String name; int code; }
class SLISAOsHostName { String name; int code; }
class SLISAOsUserName { String name; int code; }
class SLISAOsTempDir { String name; int code; }
class SLISAOsPid { String name; int code; }
class SLISAOsExists { String name; int code; }
class SLISAOsIsDir { String name; int code; }
class SLISAOsFileSize { String name; int code; }
class SLISAOsMkdir { String name; int code; }
class SLISAOsRemove { String name; int code; }
class SLISAOsRename { String name; int code; }
class SLISAOsRun { String name; int code; }
class SLISAOsSpawn { String name; int code; }
class SLISAOsWait { String name; int code; }
class SLISAOsKill { String name; int code; }
class SLISAOsPClose { String name; int code; }
class SLISAGcHint { String name; int code; }
class SLISARanMem { String name; int code; }
< Idea-canvas native-bridge opcodes (idea/realtime), codes 126..147. These >
< mirror the native OP_IC_* group appended to the SLOp enum; previously a >
< known lag, now represented so the source ISA matches the native enum. >
< OP_IC_CREATE 126 >
class SLISAIcCreate { String name; int code; }
< OP_IC_DESTROY 127 >
class SLISAIcDestroy { String name; int code; }
< OP_IC_COLS 128 >
class SLISAIcCols { String name; int code; }
< OP_IC_ROWS 129 >
class SLISAIcRows { String name; int code; }
< OP_IC_COUNT 130 >
class SLISAIcCount { String name; int code; }
< OP_IC_SETPARAMS 131 >
class SLISAIcSetParams { String name; int code; }
< OP_IC_EXCITE 132 >
class SLISAIcExcite { String name; int code; }
< OP_IC_STEP 133 >
class SLISAIcStep { String name; int code; }
< OP_IC_ADVANCE 134 >
class SLISAIcAdvance { String name; int code; }
< OP_IC_TIMESTEP 135 >
class SLISAIcTimestep { String name; int code; }
< OP_IC_INTENSITY 136 >
class SLISAIcIntensity { String name; int code; }
< OP_IC_HASREND 137 >
class SLISAIcHasRend { String name; int code; }
< OP_IC_OPENWIN 138 >
class SLISAIcOpenWin { String name; int code; }
< OP_IC_SHOULDCLOSE 139 >
class SLISAIcShouldClose { String name; int code; }
< OP_IC_PRESENT 140 >
class SLISAIcPresent { String name; int code; }
< OP_IC_RUN 141 >
class SLISAIcRun { String name; int code; }
< OP_IC_SETPOLICY 142 >
class SLISAIcSetPolicy { String name; int code; }
< OP_IC_POLICY 143 >
class SLISAIcPolicy { String name; int code; }
< OP_IC_BACKEND 144 >
class SLISAIcBackend { String name; int code; }
< OP_IC_GPUAVAIL 145 >
class SLISAIcGpuAvail { String name; int code; }
< OP_IC_MEASHZ 146 >
class SLISAIcMeasHz { String name; int code; }
< OP_IC_MIGRATE 147 >
class SLISAIcMigrate { String name; int code; }
< VM-selection service opcode (code 148): the seam the Sleela VM selector >
< (virtual-machine/vm-version/SLVmRegistry + SLVmVersion manifests) binds to, >
< so choosing a non-native VM parks a VM-exit that the native loader services >
< by building and booting the chosen version's C/C++ main. Append-only. >
< OP_VM_SELECT 148 >
class SLISAVmSelect { String name; int code; }
< OP_MODIUM_SCAN 149 >
class SLISAModiumScan { String name; int code; }
< OP_UI_CALL 150 >
class SLISAUiCall { String name; int code; }
< OP_SSEND 151 -- the ::: structural-offload send (String source -> receiver reach) >
class SLISASSend { String name; int code; }
< OP_CHECKCAST 152 >
class SLISACheckCast { String name; int code; }
< OP_INSTANCEOF 153 >
class SLISAInstanceOf { String name; int code; }
< OP_DUP2 154 >
class SLISADup2 { String name; int code; }
< OP_OSLS_CALL 155 -- typed call into the registered osls_* ABI table >
class SLISAOslsCall { String name; int code; }
< OP_BIGMUL 156 -- native big-integer multiply over base-1e9 limb arrays (the SLBigInteger VM bridge) >
class SLISABigMul { String name; int code; }
< OP_SLEEP 157 -- block the thread for a popped millisecond count (sleep() builtin and the loop-timing annotations) >
class SLISASleep { String name; int code; }
< OP_BIGADD 158 -- native big-integer add over base-1e9 limb arrays (pops a, b, result int[]; companion to OP_BIGMUL) >
class SLISABigAdd { String name; int code; }
< OP_BIGDIVMOD 159 -- native big-integer divide/remainder of a limb array by a small integer divisor (pushes the remainder; backs base conversion and Chudnovsky scaling) >
class SLISABigDivMod { String name; int code; }
< OP_BIGSUB 160 -- native big-integer subtract over base-1e9 limb arrays (pops a, b, result int[]; requires a >= b; companion to OP_BIGADD) >
class SLISABigSub { String name; int code; }
< OP_BIGDIV 161 -- native big-integer divide of big by big (pops num, den, quoOut, remOut int[]; pushes the quotient-limb count; the single large Chudnovsky final division) >
class SLISABigDiv { String name; int code; }
< OP_BIGISQRT 162 -- native big-integer floor square root over base-1e9 limb arrays (pops a, result int[]; backs sqrt(10005) in the Chudnovsky constant) >
class SLISABigISqrt { String name; int code; }
< OP_NATIVE_CALL 163 -- typed native method dispatch through the versioned scalar ABI; missing/unhandled methods and VM-only arguments may fall back to same-name SLeeLa bytecode >
class SLISANativeCall { String name; int code; }
< OP_NATIVE_OPEN 164 -- host-authorized shared-module open; pops path String and pushes opaque VM-owned generation-checked handle >
class SLISANativeOpen { String name; int code; }
< OP_NATIVE_CLOSE 165 -- closes and invalidates an opaque native-module handle; pushes null >
class SLISANativeClose { String name; int code; }
< OP_JSTR_LENGTH 166 -- return the UTF-16 code-unit length of a VM-owned Java String >
class SLISAJavaStringLength { String name; int code; }
< OP_JSTR_CHAR_AT 167 -- read one UTF-16 code unit by index >
class SLISAJavaStringCharAt { String name; int code; }
< OP_JSTR_CODE_POINT_AT 168 -- read the Unicode code point at a UTF-16 index >
class SLISAJavaStringCodePointAt { String name; int code; }
< OP_JSTR_CODE_POINT_COUNT 169 -- count Unicode code points in a UTF-16 range >
class SLISAJavaStringCodePointCount { String name; int code; }
< OP_JSTR_OFFSET_BY_CODE_POINTS 170 -- translate a code-point offset to a UTF-16 index >
class SLISAJavaStringOffsetByCodePoints { String name; int code; }
< OP_JSTR_SUBSTRING 171 -- create a Java String substring using UTF-16 indices >
class SLISAJavaStringSubstring { String name; int code; }
< OP_JSTR_CONCAT 172 -- concatenate two VM-owned Java UTF-16 Strings >
class SLISAJavaStringConcat { String name; int code; }
< OP_JSTR_HASH_CODE 173 -- compute Java String.hashCode over UTF-16 code units >
class SLISAJavaStringHashCode { String name; int code; }
< OP_JSTR_COMPARE_TO 174 -- compare Java UTF-16 Strings using String.compareTo ordering >
class SLISAJavaStringCompareTo { String name; int code; }
< OP_JSTR_FROM_UTF8 175 -- convert a validated legacy UTF-8 String into a VM-owned Java UTF-16 String >
class SLISAJavaStringFromUtf8 { String name; int code; }
< OP_TRY_PUSH 176 -- register a catch-all handler at instruction address a; captures stack height and frame depth >
class SLISATryPush { String name; int code; }
< OP_TRY_POP 177 -- remove the current frame's most recently registered exception handler >
class SLISATryPop { String name; int code; }
< OP_THROW 178 -- pop an arbitrary SLValue and dispatch it to the newest active handler; uncaught values terminate with SLR_ERROR >
class SLISAThrow { String name; int code; }
< OP_IPC_OPEN 179 -- open a host-authorized worker capability name; pushes an opaque VM-local worker handle (reserved; runtime supervisor integration pending) >
class SLISAIPcOpen { String name; int code; }
< OP_IPC_CALL 180 -- operand a is argc; stack is worker handle, method String, then arguments; pushes scalar/UTF-8 result (reserved; runtime supervisor integration pending) >
class SLISAIPcCall { String name; int code; }
< OP_IPC_CLOSE 181 -- close and invalidate a VM-local worker handle; pushes null (reserved; runtime supervisor integration pending) >
class SLISAIPcClose { String name; int code; }
< OP_REF 182 -- object reference: operand a packs a selector (low 4 bits) and, for DEREF, a class type index above them. OF pops an object or null and pushes a weak generation-checked ref (an int, 0 is null); DEREF pops a ref and pushes the object if valid and an instance of the class, else null; VALID/OLD push bool; ID/GEN/TYPE/FIELDS/BYTES/AGE push int, -1 when invalid; LIVE/LIMIT push VM-wide object counts. Never a machine address >
class SLISARef { String name; int code; }
< OP_JSTR_TO_UTF8 183 -- convert a VM-owned Java UTF-16 String to an equivalent legacy UTF-8 String; fails closed on an unpaired surrogate, an embedded NUL or text longer than SL_MAX_STRTEXT bytes >
class SLISAJavaStringToUtf8 { String name; int code; }
< OP_JSTR_FROM_CODE_UNIT 184 -- pop an integer UTF-16 code unit 0..65535 and push a one-unit VM-owned Java UTF-16 String >
class SLISAJavaStringFromCodeUnit { String name; int code; }
< OP_BAND 185 -- bitwise AND of two integers (64-bit two's complement); two bools give the non-short-circuit logical AND >
class SLISBitAnd { String name; int code; }
< OP_BOR 186 -- bitwise OR of two integers; two bools give the non-short-circuit logical OR >
class SLISBitOr { String name; int code; }
< OP_BXOR 187 -- bitwise XOR of two integers; two bools give the logical XOR >
class SLISBitXor { String name; int code; }
< OP_BSHL 188 -- shift an integer left; the count is masked to 0..63 >
class SLISBitShiftLeft { String name; int code; }
< OP_BSHR 189 -- arithmetic (sign extending) shift right; the count is masked to 0..63 >
class SLISBitShiftRight { String name; int code; }
< OP_BUSHR 190 -- logical (zero filling) shift right; the count is masked to 0..63 >
class SLISBitUnsignedShiftRight { String name; int code; }
< OP_BNOT 191 -- bitwise complement of one integer >
class SLISBitNot { String name; int code; }
< OP_CHARSTR 192 -- syntax 3.1 (SLEELA.syntax 45): pop a char (UTF-16 code unit) and push it as a one-character plain String; an unpaired surrogate or NUL is a runtime error >
class SLISCharToString { String name; int code; }
< OP_ADDCHAR 193 -- syntax 3.1 (SLEELA.syntax 45): operand a bit 0 = left operand is a char, bit 1 = right operand is a char; exactly OP_ADD, except that when either operand is a String each flagged char operand is first converted to a one-unit String of the same kind >
class SLISAddChar { String name; int code; }
< OP_NEWARRAYND 194 -- syntax 3.1 (SLEELA.syntax 46): operand a = sized dimensions n (2..8) | innermost fill kind << 8; pop n sizes (last on top) and push a rectangular array of arrays, outermost first >
class SLISNewArrayND { String name; int code; }
< OP_MATH_CALL 195 -- scalar native IEEE-754 math dispatch; operand a is stable SLMATHFunction ID; stack is null fallback marker, helper-name String, then numeric arguments; unsupported VM-owned arguments fall back to the synthesized Core helper >
class SLISMathCall { String name; int code; }
< Reserved ISA allocation — all numbers in this block except the already
implemented 195 OP_MATH_CALL are reservations, not executable entries.
Do not add reserved IDs to the source registry or native SLOp enum until
their implementation, dispatch, artifact validation, and VM compatibility
work land together. Reserved IDs are never reassigned outside their family.
Shared native math: 195..199
195 OP_MATH_CALL (implemented scalar IEEE-754 dispatch)
196 OP_MATH_ARRAY_CALL (reserved for typed VM-array dispatch)
197..199 reserved for shared math dispatch extensions
Vector: 200..207
Matrix: 208..215
Complex: 216..223
Decomposition:224..231
Transform: 232..281 (50 positions, inclusive)
Unused positions remain reserved within their assigned family. >