comparison m68k_to_x86.c @ 182:924af8b2f7a0

Fix -(a7) dest when size is byte
author Mike Pavone <pavone@retrodev.com>
date Wed, 09 Jan 2013 21:41:55 -0800
parents 3b4ef459aa8d
children 2f08d9e90a4c
comparison
equal deleted inserted replaced
181:3b4ef459aa8d 182:924af8b2f7a0
390 ea->mode = MODE_REG_DISPLACE8; 390 ea->mode = MODE_REG_DISPLACE8;
391 ea->base = CONTEXT; 391 ea->base = CONTEXT;
392 ea->disp = reg_offset(&(inst->dst)); 392 ea->disp = reg_offset(&(inst->dst));
393 break; 393 break;
394 case MODE_AREG_PREDEC: 394 case MODE_AREG_PREDEC:
395 dec_amount = inst->extra.size == OPSIZE_WORD ? 2 : (inst->extra.size == OPSIZE_LONG ? 4 : 1); 395 dec_amount = inst->extra.size == OPSIZE_WORD ? 2 : (inst->extra.size == OPSIZE_LONG ? 4 : (inst->dst.params.regs.pri == 7 ? 2 : 1));
396 if (opts->aregs[inst->dst.params.regs.pri] >= 0) { 396 if (opts->aregs[inst->dst.params.regs.pri] >= 0) {
397 out = sub_ir(out, dec_amount, opts->aregs[inst->dst.params.regs.pri], SZ_D); 397 out = sub_ir(out, dec_amount, opts->aregs[inst->dst.params.regs.pri], SZ_D);
398 } else { 398 } else {
399 out = sub_irdisp8(out, dec_amount, CONTEXT, reg_offset(&(inst->dst)), SZ_D); 399 out = sub_irdisp8(out, dec_amount, CONTEXT, reg_offset(&(inst->dst)), SZ_D);
400 } 400 }
778 dst = cmp_ir(dst, 0, flags_reg, size); 778 dst = cmp_ir(dst, 0, flags_reg, size);
779 dst = setcc_r(dst, CC_Z, FLAG_Z); 779 dst = setcc_r(dst, CC_Z, FLAG_Z);
780 dst = setcc_r(dst, CC_S, FLAG_N); 780 dst = setcc_r(dst, CC_S, FLAG_N);
781 break; 781 break;
782 case MODE_AREG_PREDEC: 782 case MODE_AREG_PREDEC:
783 dec_amount = inst->extra.size == OPSIZE_WORD ? 2 : (inst->extra.size == OPSIZE_LONG ? 4 : 1); 783 dec_amount = inst->extra.size == OPSIZE_WORD ? 2 : (inst->extra.size == OPSIZE_LONG ? 4 : (inst->dst.params.regs.pri == 7 ? 2 : 1));
784 if (opts->aregs[inst->dst.params.regs.pri] >= 0) { 784 if (opts->aregs[inst->dst.params.regs.pri] >= 0) {
785 dst = sub_ir(dst, dec_amount, opts->aregs[inst->dst.params.regs.pri], SZ_D); 785 dst = sub_ir(dst, dec_amount, opts->aregs[inst->dst.params.regs.pri], SZ_D);
786 } else { 786 } else {
787 dst = sub_irdisp8(dst, dec_amount, CONTEXT, reg_offset(&(inst->dst)), SZ_D); 787 dst = sub_irdisp8(dst, dec_amount, CONTEXT, reg_offset(&(inst->dst)), SZ_D);
788 } 788 }