use of com.rox.emu.processor.mos6502.Mos6502 in project emuRox by rossdrew.
the class Mos6502CompilerTest method testAbsoluteAddressing.
@Test
public void testAbsoluteAddressing() {
final Mos6502Compiler compiler = new Mos6502Compiler("LDA #$1C STA $100 INC $100");
Program program = compiler.compileProgram();
final int[] programByte = program.getProgramAsByteArray();
Memory memory = new SimpleMemory();
Mos6502 processor = new Mos6502(memory);
processor.reset();
memory.setBlock(0, programByte);
processor.step(3);
assertEquals(0x1D, memory.getByte(0x100));
}
use of com.rox.emu.processor.mos6502.Mos6502 in project emuRox by rossdrew.
the class Mos6502CompilerTest method testIntegration.
@Test
public void testIntegration() {
final Mos6502Compiler compiler = new Mos6502Compiler("LDA #$14 ADC #$5 STA $20");
Program program = compiler.compileProgram();
final int[] programByte = program.getProgramAsByteArray();
Memory memory = new SimpleMemory();
Mos6502 processor = new Mos6502(memory);
processor.reset();
memory.setBlock(0, programByte);
processor.step(3);
Registers registers = processor.getRegisters();
assertEquals(0x19, registers.getRegister(Registers.Register.ACCUMULATOR));
assertEquals(0x19, memory.getByte(0x20));
assertEquals(programByte.length, registers.getPC());
}
use of com.rox.emu.processor.mos6502.Mos6502 in project emuRox by rossdrew.
the class DebuggerWindow method init.
private void init() {
memory = new SimpleMemory();
processor = new Mos6502(memory);
newRegisterPanel = new Registers6502(processor.getRegisters());
}
Aggregations