src/cpu.c
void asl(byte *b, int cycles, int pcIncrease) {
	log_instruction(pcIncrease - 1, "\tASL #$%02X", b);
	bit_val(&P, flagC, bit_test(*b, flagN));

	byte shifted = *b << 1;
	bit_val(&P, flagN, bit_test(shifted, 7));
	bit_val(&P, flagZ, shifted == 0);
	*b = shifted;

	PC += pcIncrease;
	cpu_cyclesThisSec += cycles;
}
/**
 * The one really doing the hard work here. First, if the most significant bit is set, then it would overflow after
 * the shifting, so we set the carry flag.
 *
 * if the number is negative AFTER the shifting the we set the negative flag.
 */
The one really doing the hard work here. First, if the most significant bit is set, then it would overflow after
the shifting, so we set the carry flag.

if the number is negative AFTER the shifting the we set the negative flag.
The one really doing the hard work here . First if the most significant bit is set then it would overflow after the shifting so we set the carry flag . if the number is negative AFTER the shifting the we set the negative flag .
void asl(byte *b, int cycles, int pcIncrease) {
	log_instruction(pcIncrease - 1, "\tASL #$%02X", b);
	bit_val(&P, flagC, bit_test(*b, flagN));
	byte shifted = *b << 1;
	bit_val(&P, flagN, bit_test(shifted, 7));
	bit_val(&P, flagZ, shifted == 0);
	*b = shifted;
	PC += pcIncrease;
	cpu_cyclesThisSec += cycles;
}
void asl ( byte * b , int cycles , int pcIncrease ) { log_instruction ( pcIncrease - 1 , " \t " , b ) ; bit_val ( & P , flagC , bit_test ( * b , flagN ) ) ; byte shifted = * b << 1 ; bit_val ( & P , flagN , bit_test ( shifted , 7 ) ) ; bit_val ( & P , flagZ , shifted == 0 ) ; * b = shifted ; PC += pcIncrease ; cpu_cyclesThisSec += cycles ; }
The one really doing the hard work here.
The one really doing the hard work here .