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/23 14:51] – [Opcodes 20..2F] nopsledocmbytecode [2023/04/23 14:55] – [Opcodes 40..4F] nopsled
Line 346: Line 346:
  
 ===== Opcodes 30..3F ===== ===== Opcodes 30..3F =====
-=== Opcode 0x30 (48): Compare DWORDs for Equality ===+=== Opcode 0x30 (48): Compare DWORDs for Equality (cmp.eq) ===
 stack input: small/big int a (next to top); small/big int b (top of stack) stack input: small/big int a (next to top); small/big int b (top of stack)
  
Line 353: Line 353:
 note: See Opcode 22 for important notes on DWORD instructions. note: See Opcode 22 for important notes on DWORD instructions.
  
-=== Opcode 0x31 (49): Execute ===+=== Opcode 0x31 (49): Execute (exec) ===
 stack input: binary blob containing bytecode stack input: binary blob containing bytecode
  
Line 362: Line 362:
 PostScript equivalent: "exec" PostScript equivalent: "exec"
  
-=== Opcode 0x32 (50): If/Else ===+=== Opcode 0x32 (50): If/Else (ifelse) ===
 stack input: selector (smallint at second to top of stack), blob for the true case (next to top), blob for the false case (top of stack) stack input: selector (smallint at second to top of stack), blob for the true case (next to top), blob for the false case (top of stack)
  
Line 455: Line 455:
 note: in contrast to Opcode 21 "Test for Small Int Zero", this opcode has undefined behaviour of the operand is not a small integer. note: in contrast to Opcode 21 "Test for Small Int Zero", this opcode has undefined behaviour of the operand is not a small integer.
  
-=== Opcode 0x47 (71): Duplicate second-to-top ===+=== Opcode 0x47 (71): Duplicate second-to-top (index.1) ===
 effect: pushes a copy of the second-to-top (the third value if you call top-of-stack the first one) to the standard stack. effect: pushes a copy of the second-to-top (the third value if you call top-of-stack the first one) to the standard stack.
  
 PostScript equivalent: "2 index" PostScript equivalent: "2 index"
  
-=== Opcode 0x48 (72): Duplicate third-to-top ===+=== Opcode 0x48 (72): Duplicate third-to-top (index.2) ===
 effect: pushes a copy of the third-to-top (the fourth value if you call top-of-stack the first one) to the standard stack. effect: pushes a copy of the third-to-top (the fourth value if you call top-of-stack the first one) to the standard stack.
  
 PostScript equivalent: "3 index" PostScript equivalent: "3 index"
  
-=== Opcode 0x49 (73): Duplicate fourth-to-top ===+=== Opcode 0x49 (73): Duplicate fourth-to-top (index.3) ===
 effect: pushes a copy of the fourth-to-top (the 5th value if you call top-of-stack the first one) to the standard stack. effect: pushes a copy of the fourth-to-top (the 5th value if you call top-of-stack the first one) to the standard stack.
  
 PostScript equivalent: "4 index" PostScript equivalent: "4 index"
  
-=== Opcode 0x4A (74): Duplicate 5th-to-top ===+=== Opcode 0x4A (74): Duplicate 5th-to-top (index.4) ===
 effect: pushes a copy of the 5th-to-top (the 6th value if you call top-of-stack the first one) to the standard stack. effect: pushes a copy of the 5th-to-top (the 6th value if you call top-of-stack the first one) to the standard stack.
  
 PostScript equivalent: "5 index" PostScript equivalent: "5 index"
  
-=== Opcode 0x4B (75): Move Top-3 to top ===+=== Opcode 0x4B (75): Move Top-3 to top (rollin.5) ===
 effect: The value at Top-3 gets moved to top of stack, top of stack becomes top-1 and so on. effect: The value at Top-3 gets moved to top of stack, top of stack becomes top-1 and so on.
  
 PostScript equivalent: "4 -1 roll" PostScript equivalent: "4 -1 roll"
  
-=== Opcode 0x4C (76): Move Top-4 to top ===+=== Opcode 0x4C (76): Move Top-4 to top (rollin.4) ===
 effect: The value at Top-4 gets moved to top of stack, top of stack becomes top-1 and so on. effect: The value at Top-4 gets moved to top of stack, top of stack becomes top-1 and so on.
  
 PostScript equivalent: "5 -1 roll" PostScript equivalent: "5 -1 roll"
  
-=== Opcode 0x4D (77): Move Top-5 to top ===+=== Opcode 0x4D (77): Move Top-5 to top (rollin.3) ===
 effect: The value at Top-5 gets moved to top of stack, top of stack becomes top-1 and so on. effect: The value at Top-5 gets moved to top of stack, top of stack becomes top-1 and so on.
  
 PostScript equivalent: "6 -1 roll" PostScript equivalent: "6 -1 roll"
  
-=== Opcode 0x4E (78): Increment Small Int ===+=== Opcode 0x4E (78): Increment Small Int (inc.w) ===
 stack input: smallint a stack input: smallint a
  
 stack ouput: smallint (a+1) stack ouput: smallint (a+1)
  
-=== Opcode 0x4F (79): Decrement Small Int ===+=== Opcode 0x4F (79): Decrement Small Int (dec.w) ===
 stack input: smallint a stack input: smallint a
  
ocmbytecode.txt · Last modified: 2023/04/23 15:05 by nopsled

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki