Created
August 7, 2017 04:34
-
-
Save Insood/f142493255127126fff052488ad5d3bd to your computer and use it in GitHub Desktop.
i8080-core half_carry_table and !sub_half_carry_table
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add Index: (((A & 0x88) >> 1) | ((VAL & 0x88) >> 2) | ((A+B) & 0x88) >> 3)) & 0x7 | |
A VAL RES ADD Meaning | |
0 0 0 0 Both A&Val are <0x7, | |
0 0 1 0 Both A&Val are <0x7, carry from 2 to 3 (but no half-carry) | |
0 1 0 1 There was a carry from 2 to 3 which caused a carry out of 3 (ie: 0111 + 1111 = 1 000) | |
0 1 1 0 There was no carry from 2 to 3, so no carry out of 3 | |
1 0 0 1 There was a carry from 2 to 3 which caused a carry out of 3 (ie: 1111 + 0111 = 1 0000) | |
1 0 1 0 There was no carry from 2 to 3, so n ocarry out of 3 | |
1 1 0 1 There was a carry out of 3 (1000 + 1000 = 1 0000) | |
1 1 1 1 There was a carry into 3 and out of 3 (1100 + 1100 = 0 1000) | |
(((A & 0x88) >> 1) | ((VAL & 0x88) >> 2) | ((A+B) & 0x88) >> 3)) & 0x7 | |
A VAL RES SUB Meaning | |
0 0 0 1 | |
0 0 1 0 | |
0 1 0 0 | |
0 1 1 0 | |
1 0 0 1 | |
1 0 1 1 | |
1 1 0 1 | |
1 1 1 0 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment