@@ -0,0 +1,1645 @@
+package nesemu.cpu.instructions.logicArithmetic;%0A%0Aimport com.google.inject.Inject;%0Aimport lombok.AllArgsConstructor;%0Aimport nesemu.cpu.*;%0Aimport nesemu.memory.Memory;%0A%0A@Mnemonic(%22ADC%22)%0A@OpCode(code = 0x69, mode = AddressingMode.IMMEDIATE)%0A@OpCode(code = 0x65, mode = AddressingMode.ZERO_PAGE, cycles = 3)%0A@OpCode(code = 0x75, mode = AddressingMode.ZERO_PAGE_X, cycles = 4)%0A@OpCode(code = 0x61, mode = AddressingMode.INDIRECT_X, cycles = 6)%0A@OpCode(code = 0x71, mode = AddressingMode.INDIRECT_Y, cycles = 5, crossBoundaryPenalty = true)%0A@OpCode(code = 0x6D, mode = AddressingMode.ABSOLUTE, cycles = 4)%0A@OpCode(code = 0x7D, mode = AddressingMode.ABSOLUTE_X, cycles = 4, crossBoundaryPenalty = true)%0A@OpCode(code = 0x79, mode = AddressingMode.ABSOLUTE_Y, cycles = 4, crossBoundaryPenalty = true)%0A@AllArgsConstructor(onConstructor_ = @Inject)%0Apublic class Add implements Instruction %7B%0A%0A    private Registers registers;%0A%0A    private Memory memory;%0A%0A    @Override%0A    public void run(int opCode, int address) %7B%0A        int memoryValue = memory.read8Bits(address);%0A        int value = registers.getA() + memoryValue;%0A%0A        if (registers.getCarryFlag()) %7B%0A            value++;%0A        %7D%0A%0A        boolean inputValuesHaveSameSign = ((registers.getA() %5E memoryValue) & 0x80) == 0;%0A        boolean resultHasSignDifference = ((registers.getA() %5E value) & 0x80) != 0;%0A%0A        registers.setOverflowFlag(inputValuesHaveSameSign && resultHasSignDifference);%0A        registers.setCarryFlag(value %3E 255);%0A        registers.setNegativeFlag((value & 0x80) != 0);%0A        registers.setZeroFlag((value & 0xFF) == 0);%0A%0A        registers.setA(value & 0xFF);%0A    %7D%0A%7D%0A

Add operation, without a test though.