Skip to content

Commit

Permalink
Implement xchg
Browse files Browse the repository at this point in the history
  • Loading branch information
tbodt committed May 25, 2018
1 parent 8d05e5e commit 24ee6d0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions emu/gadgets-x86/math.S
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@
.ifin(\op, add,sub,adc,sbb)
setf_oc
.endifin
.ifnc \op,imul
.ifin(\op, add,sub,adc,sbb,and,or,xor)
setf_zsp %tmp\s, \ss
.endif
.endifin
.endm
.macro do_op op, size, arg
ss \size, _do_op, \op, \arg
Expand Down Expand Up @@ -110,7 +110,7 @@
.endr
.endm

.irp op, load,store,add,sub,adc,sbb,and,or,xor
.irp op, load,store,xchg,add,sub,adc,sbb,and,or,xor
.irp size, SIZE_LIST
do_op_size \op, \size
.endr
Expand Down
2 changes: 1 addition & 1 deletion emu/gen.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ static inline void gen_op(struct gen_state *state, gadget_t *gadgets, enum arg a
#define MOV(src, dst,z) load(src, z); store(dst, z)
#define MOVZX(src, dst,zs,zd) load(src, zs); store(dst, zd)
#define MOVSX(src, dst,zs,zd) load(src, zs); ga(extend, sz(zs)); store(dst, zd)
#define XCHG(src, dst,z) UNDEFINED
#define XCHG(src, dst,z) los(xchg, src, dst, z)

#define ADD(src, dst,z) los(add, src, dst, z)
#define OR(src, dst,z) los(or, src, dst, z)
Expand Down

0 comments on commit 24ee6d0

Please sign in to comment.