示例#1
0
 def op_unpack(engine):
     items = PushData.pop_array(engine)
     l = len(items)
     for i in range(l - 1, -1, -1):
         PushData.push(engine, items[i])
     PushData.push_data(engine, l)
     return VMState.NONE
示例#2
0
 def op_over(engine):
     x2 = PushData.pop_stack_item(engine)
     x1 = PushData.peek_stack_item(engine)
     PushData.peek_stack_item(engine)
     PushData.push(engine, x2)
     PushData.push(engine, x1)
     return VMState.NONE
示例#3
0
 def op_tuck(engine):
     x2 = PushData.pop_stack_item(engine)
     x1 = PushData.pop_stack_item(engine)
     PushData.push(engine, x2)
     PushData.push(engine, x1)
     PushData.push(engine, x2)
     return VMState.NONE
示例#4
0
 def op_rot(engine):
     x3 = PushData.pop_stack_item(engine)
     x2 = PushData.pop_stack_item(engine)
     x1 = PushData.pop_stack_item(engine)
     PushData.push(engine, x2)
     PushData.push(engine, x3)
     PushData.push(engine, x1)
     return VMState.NONE
示例#5
0
 def op_roll(engine):
     n = PushData.pop_int(engine)
     if n == 0:
         return VMState.NONE
     PushData.push(engine, engine.evaluation_stack.remove(n))
     return VMState.NONE
示例#6
0
 def op_pick(engine):
     n = PushData.pop_int(engine)
     if n == 0:
         return VMState.NONE
     PushData.push(engine, engine.evaluation_stack.peek(n))
     return VMState.NONE
示例#7
0
 def op_to_dup_from_alt_stack(engine):
     PushData.push(engine, engine.alt_stack.peek(0))
     return VMState.NONE
示例#8
0
 def op_nip(engine):
     x2 = PushData.pop_stack_item(engine)
     PushData.peek_stack_item(engine)
     PushData.push(engine, x2)
     return VMState.NONE
示例#9
0
 def op_dup(engine):
     items = PushData.peek_stack_item(engine)
     PushData.push(engine, items)
     return VMState.NONE
示例#10
0
 def op_from_alt_stack(engine):
     items = engine.alt_stack.pop()
     PushData.push(engine, items)
     return VMState.NONE