Beispiel #1
0
def sh2_float(obj, m, n, i):
    FRm = env.FR[m]
    Rn = env.R[n]
    obj.operands = [FRm, env.mem(Rn, 32)]
    if i:
        obj.misc['decr'] = (1, )
    obj.type = type_data_processing
Beispiel #2
0
def sh2_float(obj, m, n, i):
    FRn = env.FR[n]
    Rm = env.R[m]
    obj.operands = [env.mem(Rm, 32), FRn]
    if i:
        obj.misc['incr'] = (0, )
    obj.type = type_data_processing
Beispiel #3
0
def sh2_data_transfer(obj, n, m, d):
    Rn = env.R[n]
    Rm = env.R[m]
    scale = obj.size // 8
    disp = env.cst(d * scale, 32)
    obj.operands = [Rm, env.mem(Rn + disp, obj.size)]
    obj.type = type_data_processing
Beispiel #4
0
def sh2_data_transfer(obj, n, m, sz):
    if sz == 3: raise InstructionError(obj)
    Rn = env.R[n]
    Rm = env.R[m]
    src = env.mem(env.R[0] + Rm, 8 << sz)
    obj.operands = [src, Rn]
    obj.type = type_data_processing
Beispiel #5
0
def sh2_data_transfer(obj, m):
    Rm = env.R[m] if m != 15 else env.PR
    obj.m = m
    R15 = env.R[15]
    obj.operands = [Rm, env.mem(R15, 32)]
    obj.misc['decr'] = (1, )
    obj.type = type_data_processing
Beispiel #6
0
def sh2_default(obj, n, i, d):
    Rn = env.R[n]
    imm3 = env.cst(i, 3)
    disp = env.cst(d, 12).zeroextend(32)
    dst = env.mem(disp + Rn, obj.size)
    obj.operands = [imm3, dst]
    obj.type = type_data_processing
Beispiel #7
0
def sh2_data_transfer(obj, sz, d):
    R0 = env.R[0]
    adr = env.pc if sz == 3 else env.GBR
    scale = 1 << sz
    disp = env.cst(d * scale, 32)
    src = env.mem(adr + disp, 8 << sz)
    obj.operands = [src, R0]
    obj.type = type_data_processing
Beispiel #8
0
def sh2_data_transfer(obj, n, m, sz):
    if sz == 3: raise InstructionError(obj)
    Rn = env.R[n]
    Rm = env.R[m]
    dst = env.mem(env.R[0] + Rn, 8 << sz)
    obj.size = 8 << sz
    obj.operands = [Rm, dst]
    obj.type = type_data_processing
Beispiel #9
0
def sh2_data_transfer(obj, n, sz):
    if sz == 3: raise InstructionError(obj)
    R0 = env.R[0]
    Rn = env.R[n]
    dst = env.mem(Rn, 8 << sz)
    obj.size = 8 << sz
    obj.operands = [R0, dst]
    obj.misc['incr'] = (1, )
    obj.type = type_data_processing
Beispiel #10
0
def sh2_data_transfer(obj, m, sz):
    if sz == 3: raise InstructionError(obj)
    R0 = env.R[0]
    Rm = env.R[m]
    src = env.mem(Rm, 8 << sz)
    obj.size = 8 << sz
    obj.operands = [src, R0]
    obj.misc['decr'] = (0, )
    obj.type = type_data_processing
Beispiel #11
0
def sh2_data_transfer(obj, n, m, sz, d):
    if sz > 1: raise InstructionError(obj)
    Rn = env.R[n]
    Rm = env.R[m]
    scale = 1 << sz
    disp = env.cst(d * scale, 32)
    src = env.mem(Rm + disp, 8 << sz)
    obj.operands = [src, Rn]
    obj.type = type_data_processing
Beispiel #12
0
def sh2_data_transfer(obj, n, m, a, sz):
    Rn = env.R[n]
    Rm = env.R[m]
    dst = Rn if sz == 3 else env.mem(Rn, 8 << sz)
    if sz < 3: obj.size = 8 << sz
    obj.operands = [Rm, dst]
    if a == 1:
        if sz == 3: raise InstructionError(obj)
        obj.misc['decr'] = (1, )
    obj.type = type_data_processing
Beispiel #13
0
def sh2_data_transfer(obj, sz, d):
    if sz == 3: raise InstructionError(obj)
    R0 = env.R[0]
    adr = env.GBR
    scale = 1 << sz
    disp = env.cst(d * scale, 32)
    dst = env.mem(adr + disp, 8 << sz)
    obj.size = 8 << sz
    obj.operands = [R0, dst]
    obj.type = type_data_processing
Beispiel #14
0
def sh2_data_transfer(obj, n, m, sz, d):
    if sz == 3: raise InstructionError(obj)
    Rn = env.R[n]
    Rm = env.R[m]
    scale = 1 << sz
    disp = env.cst(d * scale, 32)
    dst = env.mem(Rn + disp, 8 << sz)
    obj.size = 8 << sz
    obj.operands = [Rm, dst]
    obj.type = type_data_processing
Beispiel #15
0
def sh2_data_transfer(obj, n, m, a, sz):
    if sz == 3: raise InstructionError(obj)
    obj.size = 8 << sz
    Rn = env.R[n]
    Rm = env.R[m]
    src = env.mem(Rm, obj.size)
    obj.operands = [src, Rn]
    if a == 1:
        obj.misc['incr'] = (0, )
    obj.type = type_data_processing
Beispiel #16
0
def sh2_data_transfer(obj, n):
    Rn = env.R[n]
    obj.operands = [env.mem(Rn, 32)]
    obj.type = type_data_processing
Beispiel #17
0
def sh2_default(obj, n, _op2):
    Rn = env.R[n]
    obj.operands = [_op2, env.mem(Rn, 32)]
    obj.misc['decr'] = (1, )
    obj.type = type_other
Beispiel #18
0
def sh2_default(obj, n):
    Rn = env.R[n]
    obj.operands = [env.R[0], env.mem(n, 32)]
    obj.type = type_other
Beispiel #19
0
def sh2_default(obj, m, _op2):
    Rm = env.R[m]
    obj.operands = [env.mem(Rm, 32), _op2]
    obj.misc['incr'] = (0, )
    obj.type = type_other
Beispiel #20
0
def sh2_default(obj, m):
    Rm = env.R[m]
    obj.operands = [env.mem(Rm, 32), env.R[0]]
    obj.type = type_other
Beispiel #21
0
def sh2_data_transfer(obj, n):
    Rn = env.R[n] if n != 15 else env.PR
    R15 = env.R[15]
    obj.operands = [env.mem(R15, 32), Rn]
    obj.misc['incr'] = (0, )
    obj.type = type_data_processing
Beispiel #22
0
def sh2_float(obj, m, n):
    FRn = env.FR[n]
    R0 = env.R[0]
    Rm = env.R[m]
    obj.operands = [env.mem(R0 + Rm, 32), FRn]
    obj.type = type_data_processing
Beispiel #23
0
def sh2_data_transfer(obj, n, d):
    Rn = env.R[n]
    scale = obj.size // 8
    disp = env.cst(d * scale, 32)
    obj.operands = [env.mem(env.pc + disp, obj.size), Rn]
    obj.type = type_data_processing
Beispiel #24
0
def sh2_float(obj, m, n):
    FRm = env.FR[m]
    R0 = env.R[0]
    Rn = env.R[n]
    obj.operands = [FRm, env.mem(R0 + Rn, 32)]
    obj.type = type_data_processing
Beispiel #25
0
def sh2_default(obj, n, m):
    Rn = env.R[n]
    Rm = env.R[m]
    obj.misc['incr'] = (0, 1)
    obj.operands = [env.mem(Rm, obj.size), env.mem(Rn, obj.size)]
    obj.type = type_data_processing
Beispiel #26
0
def sh2_float(obj, m, n, d):
    FRm = env.FR[m]
    Rn = env.R[n]
    disp = env.cst(d, 12).zeroextend(32) << 2
    obj.operands = [FRm, env.mem(Rn + disp, 32)]
    obj.type = type_data_processing
Beispiel #27
0
def sh2_default(obj, i):
    R0 = env.R[0]
    imm8 = env.cst(i, 8)
    obj.operands = [imm8, env.mem(R0 + env.GBR, 8)]
    obj.type = type_data_processing
Beispiel #28
0
def sh2_data_transfer(obj, m, d):
    Rm = env.R[m]
    scale = obj.size // 8
    disp = env.cst(d * scale, 32)
    obj.operands = [env.mem(Rm + disp, obj.size), env.R[0]]
    obj.type = type_data_processing
Beispiel #29
0
def sh2_jsr_nn(obj, d):
    imm = env.cst(d, 32)
    p = env.mem(env.TBR + imm, 32)
    obj.operands = [env.mem(p, 32)]
    obj.type = type_control_flow