-
Notifications
You must be signed in to change notification settings - Fork 483
Open
Description
Hello,
I have not the same result with a native CPU and MIASM (miasm==0.1.5.dev47) for the following instructions (X2 = 0x00000000000000; X5 = 0x000000000003F4)
0014BB24 CMP X2, 0x60
0014BB28 CCMP X5, X2, 0x2, HI
0014BB2C B.CS loc_14b9b0
The program should go in 0x14B9B0 and not in 0x14BB30 (according the native CPU),
From my understanding, Like x2 is not highter than 0x60, the NZCV should be set to 2 (ie cf = 1). I think the problem its because the ccmp intruction not set correctly flag ... (miasm/arch/aarch64/sem.py)
Attached the snipped code to reproduce the bug
loc_db = LocationDB()
machine = Machine("aarch64l")
jitter = machine.jitter(loc_db, jit_type="python")
jitter.vm.add_memory_page(0x14bb20, PAGE_READ | PAGE_WRITE | PAGE_EXEC, b'\x05\x00\x01\xcb\x5f\x80\x01\xf1\xa2\x80\x42\xfa\x22\xf4\xff\x54\xc5\x04\x00\xb4'+b'\x00'*1024 , "CODE")
jitter.set_trace_log()
jitter.cpu.X2 = 0x00000000000000
jitter.cpu.X5 = 0x000000000003F4
jitter.run(0x14bb24)
I would be very grateful if anyone could correct the problem inside this file
miasm/arch/aarch64/sem.py
https://developer.arm.com/documentation/dui0801/g/A64-General-Instructions/CCMP--register-
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels