Commit 9f83f73b authored by Julian Kranz's avatar Julian Kranz
Browse files

X86 RREIL Translator

- Added semantics of: POPF
parent b8f04a43
......@@ -9,8 +9,8 @@ val fSF = return (_var Sem_FLAGS _offset 7)
val fDF = return (_var Sem_FLAGS _offset 10)
val fOF = return (_var Sem_FLAGS _offset 11)
val eflags-low = do
flags <- return {id=Sem_FLAGS,offset=0,size=8};
val rflags = do
flags <- return {id=Sem_FLAGS,offset=0,size=64};
#Set missing bits according to manual
mov 1 (at-offset flags 1) (imm 1);
......
......@@ -1095,7 +1095,7 @@ end
val sem-lahf = do
ah <- return (semantic-register-of AH);
flags <- eflags-low;
flags <- rflags;
mov ah.size ah (var flags)
end
......@@ -1344,6 +1344,19 @@ val sem-pop x = do
commit x.opnd-sz dst (var temp-dest)
end
val sem-popf x = do
popped <- mktemp;
ps-pop x.opnd-sz popped;
flags <- rflags;
in-mask <- return 0x0000000000245fd5;
out-mask <- return 0xffffffffffc3a02a;
andb x.opndsz popped (var popped) (imm in-mask);
andb flags.size flags (var flags) (imm out-mask);
orb x.opndsz flags (var flags) (var popped)
end
val ps-push opnd-sz opnd = do
mode64 <- mode64?;
stack-addr-sz <- runtime-stack-address-size;
......@@ -2296,9 +2309,9 @@ val semantics insn =
| POPA x: sem-undef-arity0 x
| POPAD x: sem-undef-arity0 x
| POPCNT x: sem-undef-arity2 x
| POPF x: sem-undef-arity0 x
| POPFD x: sem-undef-arity0 x
| POPFQ x: sem-undef-arity0 x
| POPF x: sem-popf x
| POPFD x: sem-popf x
| POPFQ x: sem-popf x
| POR x: sem-undef-arity2 x
| PREFETCHNTA x: sem-undef-arity1 x
| PREFETCHT0 x: sem-undef-arity1 x
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment