Reputation: 9110
I am trying to simulate the x86
assembly code using z3
formulas. Currently, I am trapped in simulating the semantics of setnz
opcode.
the semantics of setnz
is defined as
checking the value of CPU flag `ZF`, and if it is equal to 1, then set a register byte as 1, otherwise set it as 0.
For example, the above procedure can be simulated in this way:
python
>>> from z3 import *
>>> a = BitVecVal(1, 1)
>>> c = (a == 1)
>>> set_register("al", c)
However, note that the type of c
is a BoolRef
, and I would like to set the value of al
as a 8-bit long BitVecVal
.
So here is my question:
set
opcodes?BoolRef
into a 8-bit long BitVecVal
in order to set the register?Upvotes: 0
Views: 202