rust-in-action / code

Source code for the book Rust in Action
https://www.manning.com/books/rust-in-action?a_aid=rust&a_bid=0367c58f&chan=github
1.9k stars 445 forks source link

ch5: incorrect value for skip operation #111

Open fcabjolsky opened 1 year ago

fcabjolsky commented 1 year ago

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]); },