code icon indicating copy to clipboard operation
code copied to clipboard

ch5: incorrect value for skip operation

Open fcabjolsky opened this issue 3 years ago • 0 comments

The operation 0x5000..=0x5FFF should compare two registers. Also the pattern match could be 0x5000..=0x5FF0 as the last byte is not used by this operation.

https://github.com/rust-in-action/code/blob/19c4349758b57bdb233e186746bfec03ad9ea88d/ch5/ch5-cpu4/src/main.rs#L33

One possible solution:

0x5000..=0x5FF0 => { self.se(x, self.registers[y as usize]); },

fcabjolsky avatar May 28 '23 21:05 fcabjolsky