示例#1
0
def _api_call(sm: VM):
    _b = get_next_byte(sm)
    _args = get_next_byte(sm, 2)
    args = [sm.pop() for _ in range(_args)]
    fun = sm.get_data_at(_b)
    f = FUNCTIONS[fun]
    f(*args)
    [sm.push(i) for i in args]
示例#2
0
def _or(sm: VM):
    b, a = sm.pop(), sm.pop()
    sm.push(a | b)
示例#3
0
def _xor(sm: VM):
    b, a = sm.pop(), sm.pop()
    sm.push(a ^ b)
示例#4
0
def _and(sm: VM):
    b, a = sm.pop(), sm.pop()
    sm.push(a & b)
示例#5
0
def _sub(sm: VM):
    b, a = sm.pop(), sm.pop()
    sm.push(a + b)
示例#6
0
def _mul(sm: VM):
    b, a = sm.pop(), sm.pop()
    sm.push(a * b)
示例#7
0
def _div(sm: VM):
    b, a = sm.pop(), sm.pop()
    sm.push(int(a / b))
示例#8
0
def _add(sm: VM):
    b, a = sm.pop(), sm.pop()
    sm.push(a + b)