Skip to content

Commit

Permalink
Merge pull request #18 from tiborbaksa/master
Browse files Browse the repository at this point in the history
fix(cpu): Underflow off-by-one bug
  • Loading branch information
Schweigi committed Aug 20, 2015
2 parents f394773 + 3ae7320 commit e55e2bf
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion assets/asmsimulator.js
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ var app = angular.module('ASMSimulator', []);
self.zero = true;
} else if (value < 0) {
self.carry = true;
value = 255 - (-value) % 256;
value = 256 - (-value) % 256;
}

return value;
Expand Down
Loading

2 comments on commit e55e2bf

@matanui159
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please push this to the online emulator? This bug makes things difficult.

@Schweigi
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@matanui159 Good catch. I pushed it.

Please sign in to comment.