Fixed DA A instruction when A is > 0xF9.

This commit is contained in:
Wilbert Pol 2008-04-13 15:09:06 +00:00
parent 842ed3efb0
commit 4725e2fa8e

View File

@ -192,7 +192,11 @@ INLINE UINT8 pull(void) {
INLINE void daa_a(void)
{
if ((R.A & 0x0f) > 0x09 || (R.PSW & A_FLAG))
{
R.A += 0x06;
if ( ! ( R.A & 0xf0 ) )
SET(C_FLAG);
}
if ((R.A & 0xf0) > 0x90 || (R.PSW & C_FLAG))
{
R.A += 0x60;