You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fn branch(&mut self, condition: bool) {
if condition {
let jump: i8 = self.mem_read(self.program_counter) as i8;
let jump_addr = self
.program_counter
.wrapping_add(1)
.wrapping_add(jump as u16);
If I change jump to u16 I get an extremely incorrect result immediately resulting in a BRK command run. The negative flag isn't set and it is immediately changed back to u16 later in the wrapping add. Any idea about this? Is there something in the documentation I am missing where this should a signed and then unsigned add?
The text was updated successfully, but these errors were encountered:
In cpu.rs
If I change jump to u16 I get an extremely incorrect result immediately resulting in a BRK command run. The negative flag isn't set and it is immediately changed back to u16 later in the wrapping add. Any idea about this? Is there something in the documentation I am missing where this should a signed and then unsigned add?
The text was updated successfully, but these errors were encountered: