User Tools

Site Tools


ocmbytecode

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
ocmbytecode [2023/04/13 16:12] – [Opcodes 50..5F] nopsledocmbytecode [2023/04/13 16:20] – [Opcodes 30..3F] nopsled
Line 69: Line 69:
  
 ===== Opcodes 00..0F ===== ===== Opcodes 00..0F =====
-=== Opcode 00: NOP ====+=== Opcode 0x00: NOP ====
 does nothing does nothing
 === Opcode 0x01: Immediate byte (value) === === Opcode 0x01: Immediate byte (value) ===
Line 367: Line 367:
 effect: if the selector is not zero, the true blob is executed (as in Opcode 31), otherwise the false blob is executed. effect: if the selector is not zero, the true blob is executed (as in Opcode 31), otherwise the false blob is executed.
  
-=== Opcode 0x33 (51): While ===+=== Opcode 0x33 (51): While (while) ===
 stack input: condition flag (smallint) stack input: condition flag (smallint)
  
Line 376: Line 376:
 note: The blob reference on the alternate stack is **not** removed by this instruction, just the condition flag on the standard stack. note: The blob reference on the alternate stack is **not** removed by this instruction, just the condition flag on the standard stack.
  
-=== Opcode 0x34 (52): Push to alternate stack ===+=== Opcode 0x34 (52): Push to alternate stack (toalt) ===
 stack input: value of any type stack input: value of any type
  
Line 383: Line 383:
 effect: The value is moved from the standard stack to the alternate stack effect: The value is moved from the standard stack to the alternate stack
  
-=== Opcode 0x35 (53): Pop from alternate stack ===+=== Opcode 0x35 (53): Pop from alternate stack (fromalt) ===
 **alternate** stack input: value of any type **alternate** stack input: value of any type
  
Line 390: Line 390:
 effect: The value is moved from the alternate stack to the standard stack effect: The value is moved from the alternate stack to the standard stack
  
-=== Opcode 0x36 (54): Peek alternate stack ===+=== Opcode 0x36 (54): Peek alternate stack (peekalt) ===
 **alternate** stack input: value of any type (not removed by this instruction) **alternate** stack input: value of any type (not removed by this instruction)
  
Line 397: Line 397:
 effect: The value is **copied** from the alternate stack to the standard stack effect: The value is **copied** from the alternate stack to the standard stack
  
-=== Opcode 0x37 (55): Push 0 ===+=== Opcode 0x37 (55): Push 0 (0) ===
 stack output: smallint containing 0 stack output: smallint containing 0
  
-=== Opcode 0x38 (56): Push 1 ===+=== Opcode 0x38 (56): Push 1 (1) ===
 stack output: smallint containing 1 stack output: smallint containing 1
  
-=== Opcode 0x39 (57): Push 2 ===+=== Opcode 0x39 (57): Push 2 (2) ===
 stack output: smallint containing 2 stack output: smallint containing 2
  
-=== Opcode 0x3A (58): Push 3 ===+=== Opcode 0x3A (58): Push 3 (3) ===
 stack output: smallint containing 3 stack output: smallint containing 3
  
-=== Opcode 0x3B (59): Push 4 ===+=== Opcode 0x3B (59): Push 4 (4) ===
 stack output: smallint containing 4 stack output: smallint containing 4
  
-=== Opcode 0x3C (60): Push 5 ===+=== Opcode 0x3C (60): Push 5 (5) ===
 stack output: smallint containing 5 stack output: smallint containing 5
  
-=== Opcode 0x3D (61): Push 6 ===+=== Opcode 0x3D (61): Push 6 (6) ===
 stack output: smallint containing 6 stack output: smallint containing 6
  
-=== Opcode 0x3E (62): Push 7 ===+=== Opcode 0x3E (62): Push 7 (7) ===
 stack output: smallint containing 7 stack output: smallint containing 7
  
-=== Opcode 0x3F (63): Push 8 ===+=== Opcode 0x3F (63): Push 8 (8) ===
 stack output: smallint containing 8 stack output: smallint containing 8
  
Line 604: Line 604:
 ===== Opcodes 60..6F ===== ===== Opcodes 60..6F =====
  
-=== Opcode 0x60: Enclose Smallint ===+=== Opcode 0x60 (96): Enclose Smallint ===
 stack input: A smallint stack input: A smallint
  
Line 611: Line 611:
 Note: the blob that gets returned is non-refcounted and lives until explicit destruction (for example by opcode 08) Note: the blob that gets returned is non-refcounted and lives until explicit destruction (for example by opcode 08)
  
-=== Opcode 0x61: Get Enclosed Smallint ===+=== Opcode 0x61 (97): Get Enclosed Smallint ===
 stack input: A blob that encloses a small integer, created by opcode 60 stack input: A blob that encloses a small integer, created by opcode 60
  
 stack output: The enclosed small integer stack output: The enclosed small integer
  
-=== Opcode 0x62: Get Significant Bits ===+=== Opcode 0x62 (98): Get Significant Bits ===
 stack input: Object of any type stack input: Object of any type
  
 stack ouput: Significant bit in that object. For smallints and bigints its the minimal number of bits to represent the absolute value of that number, for blobs the number of bytes multiplied by 8 and for arrays the sum of the number of significant bits of all entries. stack ouput: Significant bit in that object. For smallints and bigints its the minimal number of bits to represent the absolute value of that number, for blobs the number of bytes multiplied by 8 and for arrays the sum of the number of significant bits of all entries.
  
-=== Opcode 0x63: Immediate Crypted Byte ===+=== Opcode 0x63 (99): Immediate Crypted Byte ===
 immediate data: 1 byte (encrypted if OCM code encryption is enabled) immediate data: 1 byte (encrypted if OCM code encryption is enabled)
  
Line 628: Line 628:
 note: Is often used to refer to the dictionary index where the data is stored. note: Is often used to refer to the dictionary index where the data is stored.
  
-=== Opcode 0x64: Immediate Crypted Word ===+=== Opcode 0x64 (100): Immediate Crypted Word ===
 immediate data: 1 16-bit-word (encrypted if OCM code encryption is enabled) immediate data: 1 16-bit-word (encrypted if OCM code encryption is enabled)
  
 effect: pushes the signed 16 bit value of the immediate operand to the stack as small number effect: pushes the signed 16 bit value of the immediate operand to the stack as small number
  
-=== Opcode 0x65: Immediate Crypted BigInt ===+=== Opcode 0x65 (101): Immediate Crypted BigInt ===
 immediate data: 1 big int (encrypted if OCM code encryption is enabled) immediate data: 1 big int (encrypted if OCM code encryption is enabled)
  
Line 640: Line 640:
 note: If the OCM module uses the DWORD-based decryptor (it doesn't start with 03 01 in that case, we did not encounter such a module yet), it is important to know that the immediate arg is decrypted in three parts: (1) initial length byte, (2) extra length bytes, optional, (3) data bytes. note: If the OCM module uses the DWORD-based decryptor (it doesn't start with 03 01 in that case, we did not encounter such a module yet), it is important to know that the immediate arg is decrypted in three parts: (1) initial length byte, (2) extra length bytes, optional, (3) data bytes.
  
-=== Opcode 0x66: Immediate Crypted Blob ===+=== Opcode 0x66 (102): Immediate Crypted Blob ===
 immediate data: 1 blob (encrypted if OCM code encryption is enabled) immediate data: 1 blob (encrypted if OCM code encryption is enabled)
  
Line 681: Line 681:
 note: This opcode does only make sense in subthreads. note: This opcode does only make sense in subthreads.
  
-=== Opcode 0x6D: gettimeofday ===+=== Opcode 0x6D (109): gettimeofday ===
 stack output: seconds since midnight (tv_sec) as bigint (next to top); microseconds within current second (tv_usec) as bigint (top of stack) stack output: seconds since midnight (tv_sec) as bigint (next to top); microseconds within current second (tv_usec) as bigint (top of stack)
  
-=== Opcode 0x6E: mktime ===+=== Opcode 0x6E (110): mktime ===
 stack input: 6 smallint or bigint values in the following order: seconds, minutes, hours, day (1-based), month (0-based), year (top of stack) stack input: 6 smallint or bigint values in the following order: seconds, minutes, hours, day (1-based), month (0-based), year (top of stack)
  
 stack output: the corresponding unix timestamp stack output: the corresponding unix timestamp
  
-=== Opcode 0x6F: localtime ===+=== Opcode 0x6F (111): localtime ===
 stack input: a small/big int containing a unix timestamp stack input: a small/big int containing a unix timestamp
  
ocmbytecode.txt · Last modified: 2023/04/23 15:05 by nopsled

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki