diff options
| author | serpilliere <serpilliere@users.noreply.github.com> | 2015-11-09 16:16:51 +0100 |
|---|---|---|
| committer | serpilliere <serpilliere@users.noreply.github.com> | 2015-11-09 16:16:51 +0100 |
| commit | 44b450e822967664b3d53ac44023ad5b425d0340 (patch) | |
| tree | 57c46f29a8d30b13d38c13bf153b83238d239548 /test/arch/x86/unit/mn_int.py | |
| parent | ea2b165ae2b31d05dfac69bc723bb4625d434a82 (diff) | |
| parent | f7792a8efc093096c79e19e0c1ff59da3de5907e (diff) | |
| download | miasm-44b450e822967664b3d53ac44023ad5b425d0340.tar.gz miasm-44b450e822967664b3d53ac44023ad5b425d0340.zip | |
Merge pull request #261 from commial/x86-interrupt
X86 interrupt
Diffstat (limited to 'test/arch/x86/unit/mn_int.py')
| -rw-r--r-- | test/arch/x86/unit/mn_int.py | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/test/arch/x86/unit/mn_int.py b/test/arch/x86/unit/mn_int.py new file mode 100644 index 00000000..119e5b08 --- /dev/null +++ b/test/arch/x86/unit/mn_int.py @@ -0,0 +1,31 @@ +#! /usr/bin/env python +from miasm2.jitter.csts import EXCEPT_INT_XX +from asm_test import Asm_Test + + +class Test_INT(Asm_Test): + TXT = ''' + main: + INT 0x42 + RET + ''' + + def set_int_num(self, jitter): + self.int_num = jitter.cpu.get_interrupt_num() + jitter.cpu.set_exception(0) + return True + + def __init__(self): + super(Test_INT, self).__init__() + self.int_num = 0 + self.myjit.add_exception_handler(EXCEPT_INT_XX, + self.set_int_num) + + def check(self): + assert self.int_num == 0x42 + self.myjit.cpu.set_interrupt_num(14) + assert self.myjit.cpu.get_interrupt_num() == 14 + + +if __name__ == "__main__": + [test()() for test in [Test_INT]] |