Port read_moffs

This commit is contained in:
Fabian 2017-07-08 14:00:45 -05:00
parent 593ce966d0
commit 77c43a938a
2 changed files with 13 additions and 1 deletions

View file

@ -161,7 +161,6 @@ function V86Starter(options)
"_read_reg_e32s": function() { return cpu.read_reg_e32s.apply(cpu, arguments); },
"_write_reg_e16": function() { return cpu.write_reg_e16.apply(cpu, arguments); },
"_write_reg_e32": function() { return cpu.write_reg_e32.apply(cpu, arguments); },
"_read_moffs": function() { return cpu.read_moffs.apply(cpu, arguments); },
"_popa16": function() { return cpu.popa16.apply(cpu, arguments); },
"_popa32": function() { return cpu.popa32.apply(cpu, arguments); },
"_arpl": function() { return cpu.arpl.apply(cpu, arguments); },

View file

@ -708,3 +708,16 @@ void task_switch_test_mmx()
}
}
}
// read 2 or 4 byte from ip, depending on address size attribute
int32_t read_moffs()
{
if(is_asize_32())
{
return get_seg_prefix(DS) + read_op32s();
}
else
{
return get_seg_prefix(DS) + read_op16();
}
}