emu: modrm displacement, LEA instruction

This commit is contained in:
2021-03-12 08:01:28 -08:00
parent adb7e672d9
commit 0c55ff9b36
3 changed files with 109 additions and 32 deletions

View File

@@ -1,7 +1,7 @@
use emu::byteorder::{ByteOrder, LittleEndian};
use emu::dos;
use emu::i8088::i8088;
use emu::operands::{Address, LValue, Reg, RValue};
use emu::operands::{Addr, Address, LValue, Reg, RValue};
use emu::pc::Bus;
use emu::util::segoff_to_addr;
@@ -26,6 +26,10 @@ pub fn int(cpu: &mut i8088, bus: &mut Bus, num: &u8) {
}
}
pub fn lea(dst: &mut Reg, addr: &Addr) {
dst.write(addr.offset)
}
pub fn mov<T>(dst: &mut impl LValue<T>, src: &impl RValue<T>) {
dst.write(src.read());
}