本文整理汇总了Python中ut_helpers_ir.exec_instruction函数的典型用法代码示例。如果您正苦于以下问题:Python exec_instruction函数的具体用法?Python exec_instruction怎么用?Python exec_instruction使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了exec_instruction函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_di
def test_di(self):
"""Test DI execution"""
# DI
exec_instruction("DI",
[(ExprId("PSW", 32), ExprInt(1, 32))],
[(ExprId("PSW", 32), ExprInt(0, 32))])
示例2: test_ldc
def test_ldc(self):
"""Test LDC execution"""
# LDC Rn,imm5
exec_instruction("LDC R1, SAR",
[(ExprId("SAR", 32), ExprInt(0x28, 32))],
[(ExprId("R1", 32), ExprInt(0x28, 32))])
示例3: test_ei
def test_ei(self):
"""Test EI execution"""
# EI
exec_instruction("EI",
[(ExprId("PSW", 32), ExprInt(0, 32))],
[(ExprId("PSW", 32), ExprInt(1, 32))])
示例4: test_stc
def test_stc(self):
"""Test STC execution"""
# STC Rn,imm5
exec_instruction("STC R1, SAR",
[(ExprId("R1", 32), ExprInt(0x28, 32))],
[(ExprId("SAR", 32), ExprInt(0x28, 32))])
示例5: test_xor
def test_xor(self):
"""Test XOR execution"""
# XOR Rn, Rm
exec_instruction("XOR R1, R2",
[(ExprId("R1", 32), ExprInt(1, 32)), (ExprId("R2", 32), ExprInt(0, 32))],
[(ExprId("R1", 32), ExprInt(1, 32))])
示例6: test_lw
def test_lw(self):
"""Test SW execution"""
# LW Rn,(Rm)
exec_instruction("LW R1, (R2)",
[(ExprId("R2", 32), ExprInt(0x10, 32)),
(ExprMem(ExprInt(0x10, 32), 32), ExprInt(0xABCD, 32))],
[(ExprId("R1", 32), ExprInt(0xABCD, 32))])
# LW Rn,disp7.align4(SP)
exec_instruction("LW R1, 0x18(SP)",
[(ExprId("SP", 32), ExprInt(0x10, 32)),
(ExprMem(ExprInt(0x28, 32), 32), ExprInt(0x01234567, 32))],
[(ExprId("R1", 32), ExprInt(0x01234567, 32))])
# LW Rn[0-7],disp7.align4(TP)
exec_instruction("LW R1, 0x18(TP)",
[(ExprId("TP", 32), ExprInt(0x10, 32)),
(ExprMem(ExprInt(0x28, 32), 32), ExprInt(0x1010, 32))],
[(ExprId("R1", 32), ExprInt(0x1010, 32))])
# LW Rn,disp16(Rm)
exec_instruction("LW R9, 0xF000(R2)",
[(ExprId("R2", 32), ExprInt(0x42, 32)),
(ExprMem(ExprInt(0xFFFFF040, 32), 32), ExprInt(0x10, 32))],
[(ExprId("R9", 32), ExprInt(0x10, 32))])
# LW Rn,(abs24.align4)
exec_instruction("LW R10, (0x1010)",
[(ExprMem(ExprInt(0x1010, 32), 32), ExprInt(0xABC7, 32))],
[(ExprId("R10", 32), ExprInt(0xABC7, 32))])
示例7: test_xor3
def test_xor3(self):
"""Test XOR3 execution"""
# XOR3 Rn,Rm,imm16
exec_instruction("XOR3 R1, R2, 1",
[(ExprId("R2", 32), ExprInt(0, 32))],
[(ExprId("R1", 32), ExprInt(1, 32))])
示例8: test_nor
def test_nor(self):
"""Test NOR execution"""
# NOR Rn, Rm
exec_instruction("NOR R1, R2",
[(ExprId("R1", 32), ExprInt(1, 32)), (ExprId("R2", 32), ExprInt(0, 32))],
[(ExprId("R1", 32), ExprInt(0xFFFFFFFE, 32))])
示例9: test_and3
def test_and3(self):
"""Test AND3 execution"""
# AND3 Rn,Rm,imm16
exec_instruction("AND3 R1, R2, 0",
[(ExprId("R2", 32), ExprInt(1, 32))],
[(ExprId("R1", 32), ExprInt(0, 32))])
示例10: test_sw
def test_sw(self):
"""Test SW execution"""
# SW Rn,(Rm)
exec_instruction("SW R1, (R2)",
[(ExprId("R1", 32), ExprInt(0x28071010, 32)),
(ExprId("R2", 32), ExprInt(0x10, 32))],
[(ExprMem(ExprInt(0x10, 32), 32), ExprInt(0x28071010, 32))])
# SW Rn,disp7.align4(SP)
exec_instruction("SW R1, 4(SP)",
[(ExprId("R1", 32), ExprInt(0x28071010, 32)),
(ExprId("SP", 32), ExprInt(0x10, 32))],
[(ExprMem(ExprInt(0x14, 32), 32), ExprInt(0x28071010, 32))])
# SW Rn,disp7.align4(TP)
exec_instruction("SW R1, 12(TP)",
[(ExprId("R1", 32), ExprInt(0x28071010, 32)),
(ExprId("TP", 32), ExprInt(0x10, 32))],
[(ExprMem(ExprInt(0x1c, 32), 32), ExprInt(0x28071010, 32))])
# SW Rn,disp16(Rm)
exec_instruction("SW R10, 0xF800(R2)",
[(ExprId("R10", 32), ExprInt(0xABC7, 32)),
(ExprId("R2", 32), ExprInt(0x10, 32))],
[(ExprMem(ExprInt(0xFFFFF810, 32), 32), ExprInt(0xABC7, 32))])
# SW Rn,(abs24.align4)
exec_instruction("SW R10, (0x1010)",
[(ExprId("R10", 32), ExprInt(0xABC7, 32))],
[(ExprMem(ExprInt(0x1010, 32), 32), ExprInt(0xABC7, 32))])
示例11: test_and
def test_and(self):
"""Test AND execution"""
# AND Rn, Rm
exec_instruction("AND R1, R2",
[(ExprId("R1", 32), ExprInt(1, 32)), (ExprId("R2", 32), ExprInt(0, 32))],
[(ExprId("R1", 32), ExprInt(0, 32))])
示例12: test_ret
def test_ret(self):
"""Test RET execution"""
# RET
exec_instruction("RET",
[(ExprId("LP", 32), ExprInt(0x28, 32))],
[(ExprId("PC", 32), ExprInt(0x28, 32))])
示例13: test_sbvck3
def test_sbvck3(self):
"""Test SBVCK3 execution"""
# SBVCK3 R0,Rn,Rm
exec_instruction("SBVCK3 R0, R1, R2",
[(ExprId("R1", 32), ExprInt(2, 32)),
(ExprId("R2", 32), ExprInt(1, 32))],
[(ExprId("R0", 32), ExprCond(ExprOp(">",
ExprInt(3, 32),
ExprCond(ExprOp(">", ExprInt(0x2, 32), ExprInt(0x1, 32)),
ExprInt(0x2, 32),
ExprInt(0x1, 32))),
ExprInt(1, 32),
ExprInt(0, 32)))])
exec_instruction("SBVCK3 R0, R1, R2",
[(ExprId("R1", 32), ExprInt(0, 32)),
(ExprId("R2", 32), ExprInt(1, 32))],
[(ExprId("R0", 32), ExprCond(ExprOp(">",
ExprInt(1, 32),
ExprCond(ExprOp(">", ExprInt(0, 32), ExprInt(1, 32)),
ExprInt(0, 32),
ExprInt(1, 32))),
ExprInt(1, 32),
ExprInt(0, 32)))])
示例14: test_dbreak
def test_dbreak(self):
"""Test DBREAK execution"""
# DBREAK
exec_instruction("DBREAK",
[(ExprId("DBG", 32), ExprInt(0, 32))],
[(ExprId("DBG", 32), ExprInt(0b10, 32))])
示例15: test_btstm
def test_btstm(self):
"""Test BTSTM execution"""
# BTSTM R0,(Rm),imm3
exec_instruction("BTSTM R0, (R1), 1",
[(ExprId("R1", 32), ExprInt(0x28, 32)),
(ExprMem(ExprInt(0x28, 32), 8), ExprInt(0x2, 8))],
[(ExprId("R0", 32), ExprInt(0x2, 32))])