// Path: javatari/src/org/javatari/general/m6502/StatusBit.java
// public static final int bCARRY = 0;
// 
// Path: javatari/src/org/javatari/general/m6502/StatusBit.java
// public static final int bDECIMAL_MODE = 3;
// 
// Path: javatari/src/org/javatari/general/m6502/StatusBit.java
// public static final int bINTERRUPT_DISABLE = 2;
// 
// Path: javatari/src/org/javatari/general/m6502/StatusBit.java
// public static final int bOVERFLOW = 6;


import static org.javatari.general.m6502.StatusBit.bCARRY;
import static org.javatari.general.m6502.StatusBit.bDECIMAL_MODE;
import static org.javatari.general.m6502.StatusBit.bINTERRUPT_DISABLE;
import static org.javatari.general.m6502.StatusBit.bOVERFLOW;
import org.javatari.general.m6502.Instruction;
import org.javatari.general.m6502.M6502;

// Copyright 2011-2012 Paulo Augusto Peccin. See licence.txt distributed with this file.

package org.javatari.general.m6502.instructions;




public final class CLx extends Instruction {

	public CLx(M6502 cpu, int bit) {
		super(cpu);
		this.bit = bit;
	}

	@Override
	public int fetch() {
		return 2;
	}

	@Override
	public void execute() {
		if (bit == bCARRY) 					{ cpu.CARRY = false; }
		else if (bit == bDECIMAL_MODE) 		{ cpu.DECIMAL_MODE = false; }

// Path: javatari/src/org/javatari/general/m6502/StatusBit.java
// public static final int bCARRY = 0;
// 
// Path: javatari/src/org/javatari/general/m6502/StatusBit.java
// public static final int bDECIMAL_MODE = 3;
// 
// Path: javatari/src/org/javatari/general/m6502/StatusBit.java
// public static final int bINTERRUPT_DISABLE = 2;
// 
// Path: javatari/src/org/javatari/general/m6502/StatusBit.java
// public static final int bOVERFLOW = 6;


// Path: javatari/src/org/javatari/general/m6502/instructions/CLx.java
import static org.javatari.general.m6502.StatusBit.bCARRY;
import static org.javatari.general.m6502.StatusBit.bDECIMAL_MODE;
import static org.javatari.general.m6502.StatusBit.bINTERRUPT_DISABLE;
import static org.javatari.general.m6502.StatusBit.bOVERFLOW;
import org.javatari.general.m6502.Instruction;
import org.javatari.general.m6502.M6502;

// Copyright 2011-2012 Paulo Augusto Peccin. See licence.txt distributed with this file.

package org.javatari.general.m6502.instructions;




public final class CLx extends Instruction {

	public CLx(M6502 cpu, int bit) {
		super(cpu);
		this.bit = bit;
	}

	@Override
	public int fetch() {
		return 2;
	}

	@Override
	public void execute() {
		if (bit == bCARRY) 					{ cpu.CARRY = false; }
		else if (bit == bDECIMAL_MODE) 		{ cpu.DECIMAL_MODE = false; }

		else if (bit == bINTERRUPT_DISABLE) { cpu.INTERRUPT_DISABLE = false; }
