From: Christopher Zihao Lu Date: Sun, 11 May 2008 06:56:53 +0000 (-0400) Subject: Merge branch 'master' of lu@anyus.res.cmu.edu:/storage/fpga/FPGABoy X-Git-Url: http://git.joshuawise.com/fpgaboy.git/commitdiff_plain/aebd667080a34f41a93e3cf79a6c91cb2e6aaa37?hp=eaec80f24007825c7abba2affd76f74d520ce4cd Merge branch 'master' of lu@anyus.res.cmu.edu:/storage/fpga/FPGABoy --- 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.