about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorFabrice Desclaux <fabrice.desclaux@cea.fr>2014-09-02 14:42:08 +0200
committerFabrice Desclaux <fabrice.desclaux@cea.fr>2014-09-02 14:42:08 +0200
commit2659caf02742223b203821466aa162afe0ef717d (patch)
treea0946e5912c64f54f8d0bb307464e9e386af499f
parenteebb3422f0c9606a92933630aa8cc02ac4b6d7bd (diff)
downloadmiasm-2659caf02742223b203821466aa162afe0ef717d.tar.gz
miasm-2659caf02742223b203821466aa162afe0ef717d.zip
mips example: modify example for reg tests
Diffstat (limited to '')
-rw-r--r--example/asm_mips32.py10
-rw-r--r--example/test_jit_mips32.py4
2 files changed, 8 insertions, 6 deletions
diff --git a/example/asm_mips32.py b/example/asm_mips32.py
index c28519b9..83e7a90b 100644
--- a/example/asm_mips32.py
+++ b/example/asm_mips32.py
@@ -30,14 +30,16 @@ st = StrPatchwork()
 blocs, symbol_pool = parse_asm.parse_txt(mn_mips32, "l", '''
 main:
     ADDIU      A0, ZERO, 0x10
-    ADDIU         A1, ZERO, 0
+    ADDIU      A1, ZERO, 0
 loop:
     ADDIU      A1, A1, 0x1
-    ADDIU      A0, A0, 0xFFFFFFFF
     BNE        A0, ZERO, loop
-    NOP
+    ADDIU      A0, A0, 0xFFFFFFFF
+
+    ADDIU      A2, A2, 0x1
+    MOVN       A1, ZERO, ZERO
     JR         RA
-    NOP
+    ADDIU      A2, A2, 0x1
 ''')
 
 # fix shellcode addr
diff --git a/example/test_jit_mips32.py b/example/test_jit_mips32.py
index 2e18b9dd..5dd9175d 100644
--- a/example/test_jit_mips32.py
+++ b/example/test_jit_mips32.py
@@ -70,8 +70,8 @@ def jit_mips32_binary(args):
 
     else:
         print(myjit.continue_run())
-
+    return myjit
 if __name__ == '__main__':
     from sys import stderr
     args = parser.parse_args()
-    jit_mips32_binary(args)
+    myjit = jit_mips32_binary(args)