src/cpu.c
void dcm(word addr, int cycles, int pcIncrease) {
	log_instruction(pcIncrease - 1, "\tDCP $%02X", addr);

	delta_memory(addr, -1, 0, 0);

	byte value = rmem_b(addr);
	byte temp_result = A - value;

	bit_val(&P, flagC, A >= value);

	//Need to do this since there are some positive numbers that should trigger this flag. i.e. 0x80
	bit_val(&P, flagN, bit_test(temp_result, 7));
	bit_val(&P, flagZ, A == value);

	PC += pcIncrease;
	cpu_cyclesThisSec += cycles;
}
/**
 * It is the equivalent as to do a dec_mem and a cmp, so we'll just execute those two on order. It should be fine
 */
It is the equivalent as to do a dec_mem and a cmp, so we'll just execute those two on order. It should be fine
It is the equivalent as to do a dec_mem and a cmp so we ' ll just execute those two on order . It should be fine
void dcm(word addr, int cycles, int pcIncrease) {
	log_instruction(pcIncrease - 1, "\tDCP $%02X", addr);
	delta_memory(addr, -1, 0, 0);
	byte value = rmem_b(addr);
	byte temp_result = A - value;
	bit_val(&P, flagC, A >= value);
	bit_val(&P, flagN, bit_test(temp_result, 7));
	bit_val(&P, flagZ, A == value);
	PC += pcIncrease;
	cpu_cyclesThisSec += cycles;
}
void dcm ( word addr , int cycles , int pcIncrease ) { log_instruction ( pcIncrease - 1 , " \t " , addr ) ; delta_memory ( addr , -1 , 0 , 0 ) ; byte value = rmem_b ( addr ) ; byte temp_result = A - value ; bit_val ( & P , flagC , A >= value ) ; bit_val ( & P , flagN , bit_test ( temp_result , 7 ) ) ; bit_val ( & P , flagZ , A == value ) ; PC += pcIncrease ; cpu_cyclesThisSec += cycles ; }
It is the equivalent as to do a dec_mem and a cmp, so we'll just execute those two on order.
It is the equivalent as to do a dec_mem and a cmp so we ' ll just execute those two on order .
//Need to do this since there are some positive numbers that should trigger this flag. i.e. 0x80