Mercurial > repos > blastem
comparison m68k_core_x86.c @ 751:cf09b189a0ca
Fix negative offsets in calc_areg_displace
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Mon, 22 Jun 2015 22:00:02 -0700 |
parents | fbda8e865dae |
children | 483f7e7926a6 |
comparison
equal
deleted
inserted
replaced
750:59b499f6b24f | 751:cf09b189a0ca |
---|---|
315 } | 315 } |
316 | 316 |
317 void calc_areg_displace(m68k_options *opts, m68k_op_info *op, uint8_t native_reg) | 317 void calc_areg_displace(m68k_options *opts, m68k_op_info *op, uint8_t native_reg) |
318 { | 318 { |
319 areg_to_native(opts, op->params.regs.pri, native_reg); | 319 areg_to_native(opts, op->params.regs.pri, native_reg); |
320 add_ir(&opts->gen.code, op->params.regs.displacement, native_reg, SZ_D); | 320 add_ir(&opts->gen.code, op->params.regs.displacement & 0x8000 ? op->params.regs.displacement | 0xFFFF0000 : op->params.regs.displacement, native_reg, SZ_D); |
321 } | 321 } |
322 | 322 |
323 void calc_index_disp8(m68k_options *opts, m68k_op_info *op, uint8_t native_reg) | 323 void calc_index_disp8(m68k_options *opts, m68k_op_info *op, uint8_t native_reg) |
324 { | 324 { |
325 uint8_t sec_reg = (op->params.regs.sec >> 1) & 0x7; | 325 uint8_t sec_reg = (op->params.regs.sec >> 1) & 0x7; |