Пример #1
0
    def test_can_string_op(self):
        op = opcodes.op_or()
        op.operands = [0x03, 0x04]
        op.optypes = [opcodes.TYPE_SMALL, opcodes.TYPE_SMALL]
        op.store_loc = 0x00
        op.bytes = [0x00, 0x01]

        self.assertEquals(
            "0x08 -opcodes.op_or (0x03 0x04 ) types ([Small (1), Small (1)]) -> (0) [0x00 0x01 ]", str(op)
        )
Пример #2
0
    def test_op_or(self):
        op = opcodes.op_or()
        op.operands = [0x03, 0x04]
        op.optypes = [opcodes.TYPE_SMALL, opcodes.TYPE_SMALL]
        op.store_loc = 0x00

        self.cpu.set_variable(0x00, 0x07)

        self.mymox.ReplayAll()
        op.execute(self.cpu)
        self.mymox.VerifyAll()
Пример #3
0
    def test_op_or_var(self):
        op = opcodes.op_or()
        op.operands = [0x00, 0x01]
        op.optypes = [opcodes.TYPE_VAR, opcodes.TYPE_VAR]
        op.store_loc = 0x00

        self.cpu.get_variable(0x00).AndReturn(0x06)
        self.cpu.get_variable(0x01).AndReturn(0x04)
        self.cpu.set_variable(0x00, 0x06)

        self.mymox.ReplayAll()
        op.execute(self.cpu)
        self.mymox.VerifyAll()