Skip to content

Commit

Permalink
Implement adc and sbb
Browse files Browse the repository at this point in the history
  • Loading branch information
tbodt committed May 25, 2018
1 parent 93788b4 commit 18bac9a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 6 additions & 3 deletions emu/gadgets-x86/math.S
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,19 @@
.else; .ifc \op,store
mov\ss %tmp\s, \arg
.else
.ifin(\op, add,sub)
.ifin(\op, add,sub,adc,sbb)
mov\ss \arg, %r14\s
setf_a src=%r14\s, dst=%tmp\s, ss=\ss
.endifin
.ifin(\op, and,or,xor)
clearf_a
clearf_oc
.endifin
.ifin(\op, adc,sbb)
btw $0, CPU_cf(%_cpu)
.endifin
\op\ss \arg, %tmp\s
.ifin(\op, add,sub)
.ifin(\op, add,sub,adc,sbb)
setf_oc
.endifin
setf_zsp %tmp\s, \ss
Expand Down Expand Up @@ -103,7 +106,7 @@
.endr
.endm

.irp op, load,store,add,sub,and,or,xor
.irp op, load,store,add,sub,adc,sbb,and,or,xor
.irp size, SIZE_LIST
do_op_size \op, \size
.endr
Expand Down
4 changes: 2 additions & 2 deletions emu/gen.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ static inline void gen_op(struct gen_state *state, gadget_t *gadgets, enum arg a

#define ADD(src, dst,z) los(add, src, dst, z)
#define OR(src, dst,z) los(or, src, dst, z)
#define ADC(src, dst,z) UNDEFINED
#define SBB(src, dst,z) UNDEFINED
#define ADC(src, dst,z) los(adc, src, dst, z)
#define SBB(src, dst,z) los(sbb, src, dst, z)
#define AND(src, dst,z) los(and, src, dst, z)
#define SUB(src, dst,z) los(sub, src, dst, z)
#define XOR(src, dst,z) los(xor, src, dst, z)
Expand Down

0 comments on commit 18bac9a

Please sign in to comment.