def op_0x58(frame): # pop2 value = frame.stack.pop() if category_type(value) == 2: pass else: value = frame.stack.pop() assert category_type(value) == 1
def pop2(frame): value = frame.stack.pop() if category_type(value) == 2: pass else: value = frame.stack.pop() assert category_type(value) == 1
def dup_x1(frame): value1 = frame.stack.pop() value2 = frame.stack.pop() assert category_type(value1) == 1 assert category_type(value2) == 1 frame.stack.append(value1) frame.stack.append(value2) frame.stack.append(value1)
def op_0x5a(frame): # dup_x1 value1 = frame.stack.pop() value2 = frame.stack.pop() assert category_type(value1) == 1 assert category_type(value2) == 1 frame.stack.append(value1) frame.stack.append(value2) frame.stack.append(value1)
def dup2(frame): value1 = frame.stack.pop() if category_type(value1) == 2: # form 2 frame.stack.append(value1) frame.stack.append(value1) return value2 = frame.stack.pop() if category_type(value1) == 1 and category_type(value2) == 1: # form 1 frame.stack.append(value2) frame.stack.append(value1) frame.stack.append(value2) frame.stack.append(value1) return assert False # should never get here
def op_0x5c(frame): # dup2 value1 = frame.stack.pop() if category_type(value1) == 2: # form 2 frame.stack.append(value1) frame.stack.append(value1) return value2 = frame.stack.pop() if category_type(value1) == 1 and category_type(value2) == 1: # form 1 frame.stack.append(value2) frame.stack.append(value1) frame.stack.append(value2) frame.stack.append(value1) return assert False # should never get here
def dup_x2(frame): value1 = frame.stack.pop() value2 = frame.stack.pop() if category_type(value1) == 1 and category_type(value2) == 2: # form2 frame.stack.append(value1) frame.stack.append(value2) frame.stack.append(value1) return value3 = frame.stack.pop() if category_type(value1) == 1 and category_type(value2) == 1 and category_type(value3 == 1): # form 1 frame.stack.append(value1) frame.stack.append(value3) frame.stack.append(value2) frame.stack.append(value1) return assert False # should never get here
def op_0x59(frame): # dup value = frame.stack.pop() assert category_type(value) == 1 frame.stack.append(value) frame.stack.append(value)
def op_0x57(frame): # pop value = frame.stack.pop() assert category_type(value) == 1
def op_0x5e(frame): # dup2_x2 value1 = frame.stack.pop() value2 = frame.stack.pop() if category_type(value1) == 2 and category_type(value2) == 2: # form 4 frame.stack.append(value1) frame.stack.append(value2) frame.stack.append(value1) return value3 = frame.stack.pop() if (category_type(value1) == 1 and category_type(value2) == 1 and category_type(value3) == 2): # form 3 frame.stack.append(value2) frame.stack.append(value1) frame.stack.append(value3) frame.stack.append(value2) frame.stack.append(value1) return if (category_type(value1) == 2 and category_type(value2) == 1 and category_type(value3) == 1): # form 2 frame.stack.append(value1) frame.stack.append(value3) frame.stack.append(value2) frame.stack.append(value1) return value4 = frame.stack.pop() if (category_type(value1) == 1 and category_type(value2) == 1 and category_type(value3) == 1 and category_type(value4) == 1): # form 1 frame.stack.append(value2) frame.stack.append(value1) frame.stack.append(value4) frame.stack.append(value3) frame.stack.append(value2) frame.stack.append(value1) return assert False # should never get here
def pop(frame): value = frame.stack.pop() assert category_type(value) == 1
def dup2_x2(frame): value1 = frame.stack.pop() value2 = frame.stack.pop() if category_type(value1) == 2 and category_type(value2) == 2: # form 4 frame.stack.append(value1) frame.stack.append(value2) frame.stack.append(value1) return value3 = frame.stack.pop() if (category_type(value1) == 1 and category_type(value2) == 1 and category_type(value3) == 2): # form 3 frame.stack.append(value2) frame.stack.append(value1) frame.stack.append(value3) frame.stack.append(value2) frame.stack.append(value1) return if (category_type(value1) == 2 and category_type(value2) == 1 and category_type(value3) == 1): # form 2 frame.stack.append(value1) frame.stack.append(value3) frame.stack.append(value2) frame.stack.append(value1) return value4 = frame.stack.pop() if (category_type(value1) == 1 and category_type(value2) == 1 and category_type(value3) == 1 and category_type(value4) == 1): # form 1 frame.stack.append(value2) frame.stack.append(value1) frame.stack.append(value4) frame.stack.append(value3) frame.stack.append(value2) frame.stack.append(value1) return assert False # should never get here
def dup(frame): value = frame.stack.pop() assert category_type(value) == 1 frame.stack.append(value) frame.stack.append(value)