Difference between revisions of "LSO"

From Second Life Wiki
Jump to navigation Jump to search
Line 9: Line 9:


== Complete List ==
== Complete List ==
{| class="sortable" {{Prettytable}}
{{LSO/Bytecode|all=*}}
|-{{Hl2}}
!Name
!Value
!class="unsortable"|Description
|-
||NOOP||{{LSL Hex|0x00}}||
|-
||POP||{{LSL Hex|0x01}}||
|-
||POPS||{{LSL Hex|0x02}}||
|-
||POPL||{{LSL Hex|0x03}}||
|-
||POPV||{{LSL Hex|0x04}}||
|-
||POPQ||{{LSL Hex|0x05}}||
|-
||POPARG||{{LSL Hex|0x06}}||
|-
||POPIP||{{LSL Hex|0x07}}||
|-
||POPBP||{{LSL Hex|0x08}}||
|-
||POPSP||{{LSL Hex|0x09}}||
|-
||POPSLR||{{LSL Hex|0x0a}}||
|-
||DUP||{{LSL Hex|0x20}}||
|-
||DUPS||{{LSL Hex|0x21}}||
|-
||DUPL||{{LSL Hex|0x22}}||
|-
||DUPV||{{LSL Hex|0x23}}||
|-
||DUPQ||{{LSL Hex|0x24}}||
|-
||STORE||{{LSL Hex|0x30}}||
|-
||STORES||{{LSL Hex|0x31}}||
|-
||STOREL||{{LSL Hex|0x32}}||
|-
||STOREV||{{LSL Hex|0x33}}||
|-
||STOREQ||{{LSL Hex|0x34}}||
|-
||STOREG||{{LSL Hex|0x35}}||
|-
||STOREGS||{{LSL Hex|0x36}}||
|-
||STOREGL||{{LSL Hex|0x37}}||
|-
||STOREGV||{{LSL Hex|0x38}}||
|-
||STOREGQ||{{LSL Hex|0x39}}||
|-
||LOADP||{{LSL Hex|0x3a}}||
|-
||LOADSP||{{LSL Hex|0x3b}}||
|-
||LOADLP||{{LSL Hex|0x3c}}||
|-
||LOADVP||{{LSL Hex|0x3d}}||
|-
||LOADQP||{{LSL Hex|0x3e}}||
|-
||LOADGP||{{LSL Hex|0x3f}}||
|-
||LOADGSP||{{LSL Hex|0x40}}||
|-
||LOADGLP||{{LSL Hex|0x41}}||
|-
||LOADGVP||{{LSL Hex|0x42}}||
|-
||LOADGQP||{{LSL Hex|0x43}}||
|-
||PUSH||{{LSL Hex|0x50}}||
|-
||PUSHS||{{LSL Hex|0x51}}||
|-
||PUSHL||{{LSL Hex|0x52}}||
|-
||PUSHV||{{LSL Hex|0x53}}||
|-
||PUSHQ||{{LSL Hex|0x54}}||
|-
||PUSHG||{{LSL Hex|0x55}}||
|-
||PUSHGS||{{LSL Hex|0x56}}||
|-
||PUSHGL||{{LSL Hex|0x57}}||
|-
||PUSHGV||{{LSL Hex|0x58}}||
|-
||PUSHGQ||{{LSL Hex|0x59}}||
|-
||PUSHIP||{{LSL Hex|0x5a}}||
|-
||PUSHBP||{{LSL Hex|0x5b}}||
|-
||PUSHSP||{{LSL Hex|0x5c}}||
|-
||PUSHARGB||{{LSL Hex|0x5d}}||
|-
||PUSHARGI||{{LSL Hex|0x5e}}||
|-
||PUSHARGF||{{LSL Hex|0x5f}}||
|-
||PUSHARGS||{{LSL Hex|0x60}}||
|-
||PUSHARGV||{{LSL Hex|0x61}}||
|-
||PUSHARGQ||{{LSL Hex|0x62}}||
|-
||PUSHE||{{LSL Hex|0x63}}||
|-
||PUSHEV||{{LSL Hex|0x64}}||
|-
||PUSHEQ||{{LSL Hex|0x65}}||
|-
||PUSHARGE||{{LSL Hex|0x66}}||
|-
||ADD||{{LSL Hex|0x70}}||
|-
||SUB||{{LSL Hex|0x71}}||
|-
||MUL||{{LSL Hex|0x72}}||
|-
||DIV||{{LSL Hex|0x73}}||
|-
||MOD||{{LSL Hex|0x74}}||
|-
||EQ||{{LSL Hex|0x75}}||
|-
||NEQ||{{LSL Hex|0x76}}||
|-
||LEQ||{{LSL Hex|0x77}}||
|-
||GEQ||{{LSL Hex|0x78}}||
|-
||LESS||{{LSL Hex|0x79}}||
|-
||GREATER||{{LSL Hex|0x7a}}||
|-
||BITAND||{{LSL Hex|0x7b}}||
|-
||BITOR||{{LSL Hex|0x7c}}||
|-
||BITXOR||{{LSL Hex|0x7d}}||
|-
||BOOLAND||{{LSL Hex|0x7e}}||
|-
||BOOLOR||{{LSL Hex|0x7f}}||
|-
||NEG||{{LSL Hex|0x80}}||
|-
||BITNOT||{{LSL Hex|0x81}}||
|-
||BOOLNOT||{{LSL Hex|0x82}}||
|-
||JUMP||{{LSL Hex|0x90}}||
|-
||JUMPIF||{{LSL Hex|0x91}}||
|-
||JUMPNIF||{{LSL Hex|0x92}}||
|-
||STATE||{{LSL Hex|0x93}}||
|-
||CALL||{{LSL Hex|0x94}}||
|-
||RETURN||{{LSL Hex|0x95}}||
|-
||CAST||{{LSL Hex|0xa0}}||
|-
||STACKTOS||{{LSL Hex|0xb0}}||
|-
||STACKTOL||{{LSL Hex|0xb1}}||
|-
||PRINT||{{LSL Hex|0xc0}}||
|-
||CALLLIB||{{LSL Hex|0xd0}}||
|-
||CALLLIB_TWO_BYTE||{{LSL Hex|0xd1}}||
|-
||SHL||{{LSL Hex|0xe0}}||
|-
||SHR||{{LSL Hex|0xe1}}||
|}

Revision as of 02:40, 26 November 2007

The compiled form of LSL scripts - a mostly stack-based language with a reference-counted heap and a very odd function calling convention in which the caller allocates storage for the callee's local variables. All the gory details can be found at http://www.libsecondlife.org/wiki/LSO, including some opcodes that are implemented in the interpreter but never outputted by the compiler (such as the handy DUP family of instructions for Forth-style programming, and PUSHIP/POPIP for implementing custom function calls/function pointers, jumptable-based switch statements and the like).

It's actually a reasonably powerful instruction set in some ways, but the compiler doesn't make use of it very well. Of course, with the planned switch to Mono, it's probably really not sensible to do anything with it. Besides, rumor has it that script compilation will move server-side in the near future.

Bytecodes by Task

Pop

These bytecodes remove values from the stack.

Complete List

Template:LSO/Bytecode