/** * Opcode : cpu_ops_8b_add * void cpu_ops_8b_add (REG8 *dest, REG8 value, UINT32 *zero, UINT32 *negative, UINT32 *half_carry, UINT32 *carry) **/ void test_cpu_ops_8b_add () { printf ("test/cpu_ops_8b_add result: "); target = 0x00; zero = negative = half = carry = FALSE; cpu_ops_8b_add (&target, 0x0F, &zero, &negative, &half, &carry); assert (target == 0x0F && !zero && !negative && !half && !carry); cpu_ops_8b_add (&target, 0x01, &zero, &negative, &half, &carry); assert (target == 0x10 && !zero && !negative && half && !carry); cpu_ops_8b_add (&target, 0xEF, &zero, &negative, &half, &carry); assert (target == 0xFF && !zero && !negative && !half && !carry); cpu_ops_8b_add (&target, 0x01, &zero, &negative, &half, &carry); assert (target == 0x00 && zero && !negative && half && carry); printf ("success\n"); }
void cpu_ops_8b_adc (REG8 *dest, REG8 value, UINT32 *zero, UINT32 *negative, UINT32 *half_carry, UINT32 *carry) { cpu_ops_8b_add (dest, value + *carry, zero, negative, half_carry, carry); }