fix(interrupt): parse correct amount of data
This commit is contained in:
@@ -760,12 +760,12 @@ impl Interpreter {
|
||||
|
||||
fn interpret_interrupt(&self, id: u8) -> Result<(), InterpreterError> {
|
||||
let bx = self.computer.regs.bx.read();
|
||||
let w1 = self.computer.read(bx.into())?;
|
||||
let w2 = self.computer.read((bx + 2).into())?;
|
||||
|
||||
let mut data = Vec::new();
|
||||
data.extend_from_slice(&w1.to_le_bytes());
|
||||
data.extend_from_slice(&w2.to_le_bytes());
|
||||
for i in 0..8 {
|
||||
let word = self.computer.read((bx + 2 * i).into())?;
|
||||
data.extend_from_slice(&word.to_le_bytes());
|
||||
}
|
||||
|
||||
let msg = InterruptMessage::new(&data);
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ pub struct Mess1 {
|
||||
|
||||
impl Mess1 {
|
||||
pub fn new(data: &Vec<u8>) -> Self {
|
||||
log::debug!("Mess1 from data {data:?}");
|
||||
Self {
|
||||
i1: Word::from_le_bytes([data[4], data[5]]),
|
||||
i2: Word::from_le_bytes([data[6], data[7]]),
|
||||
|
||||
Reference in New Issue
Block a user