package playingcoffee.core;

public class Opcode {

	private Op[] ops;
	
	private final Registers registers;
	private final MMU mmu;
	
	private int stored;
	
	public Opcode(Registers registers, MMU mmu, Op... ops) {
		this.registers = registers;
		this.mmu = mmu;
		
		this.ops = ops;
	}
	
	public void execute(Registers regs, MMU mmu) {
		for (Op op : ops)
			op.execute();
	}
	
	public interface Op {
		
		public void execute();
	
	}
	
	public class Read16BitOperand implements Op {
		@Override
		public void execute() {
			stored = (mmu.read(registers.pc++) << 8) | mmu.read(registers.pc);
		}	
	}
}
