ft(interpreter): impl far jumps with correct CS addressing
This commit is contained in:
@@ -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
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user