From: Joshua Wise Date: Sun, 11 May 2008 06:56:14 +0000 (-0400) Subject: daa.txt X-Git-Url: http://git.joshuawise.com/fpgaboy.git/commitdiff_plain/a761b30bbbc290f68e0c8b270ad929c7159f0ad8?hp=492e55f50f4660d16be8e81466813096d492e67d daa.txt --- diff --git a/daa.txt b/daa.txt new file mode 100644 index 0000000..74c374f --- /dev/null +++ b/daa.txt @@ -0,0 +1,29 @@ + +-------------------------------------------------------------------------------- +| | C Flag | HEX value in | H Flag | HEX value in | Number | C flag | +| Operation | Before | upper digit | Before | lower digit | added | After | +| | DAA | (bit 7-4) | DAA | (bit 3-0) | to byte | DAA | +|------------------------------------------------------------------------------| +| | 0 | 0-9 | 0 | 0-9 | 00 | 0 | +| ADD | 0 | 0-8 | 0 | A-F | 06 | 0 | +| | 0 | 0-9 | 1 | 0-3 | 06 | 0 | +| ADC | 0 | A-F | 0 | 0-9 | 60 | 1 | +| | 0 | 9-F | 0 | A-F | 66 | 1 | +| INC | 0 | A-F | 1 | 0-3 | 66 | 1 | +| | 1 | 0-2 | 0 | 0-9 | 60 | 1 | +| | 1 | 0-2 | 0 | A-F | 66 | 1 | +| | 1 | 0-3 | 1 | 0-3 | 66 | 1 | +|------------------------------------------------------------------------------| +| SUB | 0 | 0-9 | 0 | 0-9 | 00 | 0 | +| SBC | 0 | 0-8 | 1 | 6-F | FA | 0 | +| DEC | 1 | 7-F | 0 | 0-9 | A0 | 1 | +| NEG | 1 | 6-F | 1 | 6-F | 9A | 1 | +|------------------------------------------------------------------------------| + +Flags: +C: See instruction. +N: Unaffected. +P/V: Set if Acc. is even parity after operation, reset otherwise. +H: See instruction. +Z: Set if Acc. is Zero after operation, reset otherwise. +S: Set if most significant bit of Acc. is 1 after operation, reset otherwise.