ft(interpreter): impl far jumps with correct CS addressing

This commit is contained in:
2025-06-18 16:41:49 +09:00
parent 6678a1ef4a
commit 4aeacc649a
8 changed files with 116 additions and 30 deletions

View File

@@ -162,3 +162,32 @@ gen_regs!(AX);
gen_regs!(BX);
gen_regs!(CX);
gen_regs!(DX);
#[derive(Debug, Clone, Copy)]
pub struct SegmentRegister {
pub ds: Word,
pub es: Word,
pub ss: Word,
pub cs: Word,
}
impl SegmentRegister {
pub fn new() -> Self {
Self {
ds: 0,
es: 0,
ss: 0,
cs: 0,
}
}
}
impl fmt::Display for SegmentRegister {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"DS({}) ES({}) SS({}) CS({})",
self.ds, self.es, self.ss, self.cs
)
}
}