# HG changeset patch # User Michael Pavone # Date 1489123891 28800 # Node ID 779920729249c56db1b6809b8bce29ea93ceaa52 # Parent 6dedaa6458438f5b769b738d7db575b083e3042a Forgot to update flags in the "good" case of the new divu code diff -r 6dedaa645843 -r 779920729249 m68k_core_x86.c --- a/m68k_core_x86.c Thu Mar 09 19:23:24 2017 -0800 +++ b/m68k_core_x86.c Thu Mar 09 21:31:31 2017 -0800 @@ -1783,15 +1783,17 @@ //TODO: inline the functionality of divu so we don't need to dump context to memory call_args(code, (code_ptr)divu, 3, opts->gen.scratch2, opts->gen.context_reg, opts->gen.scratch1); pop_r(code, opts->gen.context_reg); - if (dst_op->mode == MODE_REG_DIRECT) { - mov_rr(code, RAX, opts->gen.scratch1, SZ_D); - } else { - mov_rrdisp(code, RAX, dst_op->base, dst_op->disp, SZ_D); - } + mov_rr(code, RAX, opts->gen.scratch1, SZ_D); + call(code, opts->gen.load_context); + cmp_ir(code, 0, opts->gen.scratch1, SZ_W); + update_flags(opts, V0|Z|N); + if (dst_op->mode == MODE_REG_DIRECT) { mov_rr(code, opts->gen.scratch1, dst_op->base, SZ_D); + } else { + mov_rrdisp(code, RAX, dst_op->base, dst_op->disp, SZ_D); } *end = code->cur - (end + 1);