Search in sources :

Example 1 with Mos6502

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));
}
Also used : Program(com.rox.emu.processor.mos6502.util.Program) SimpleMemory(com.rox.emu.mem.SimpleMemory) Memory(com.rox.emu.mem.Memory) SimpleMemory(com.rox.emu.mem.SimpleMemory) Mos6502Compiler(com.rox.emu.processor.mos6502.util.Mos6502Compiler) Test(org.junit.Test)

Example 2 with Mos6502

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());
}
Also used : Program(com.rox.emu.processor.mos6502.util.Program) SimpleMemory(com.rox.emu.mem.SimpleMemory) Memory(com.rox.emu.mem.Memory) SimpleMemory(com.rox.emu.mem.SimpleMemory) Mos6502Compiler(com.rox.emu.processor.mos6502.util.Mos6502Compiler) Test(org.junit.Test)

Example 3 with Mos6502

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());
}
Also used : Registers6502(com.rox.emu.processor.mos6502.dbg.ui.component.Registers6502) SimpleMemory(com.rox.emu.mem.SimpleMemory) Mos6502(com.rox.emu.processor.mos6502.Mos6502)

Aggregations

SimpleMemory (com.rox.emu.mem.SimpleMemory)3 Memory (com.rox.emu.mem.Memory)2 Mos6502Compiler (com.rox.emu.processor.mos6502.util.Mos6502Compiler)2 Program (com.rox.emu.processor.mos6502.util.Program)2 Test (org.junit.Test)2 Mos6502 (com.rox.emu.processor.mos6502.Mos6502)1 Registers6502 (com.rox.emu.processor.mos6502.dbg.ui.component.Registers6502)1