Skip to content

Latest commit

 

History

History
38 lines (32 loc) · 1.04 KB

README.md

File metadata and controls

38 lines (32 loc) · 1.04 KB

sixtyfiveohtwo

A 6502 Assembly emulator, soon to be part of an NES emulator.

GitHub

Instructions can be written out in Rust code, checked by the type system.

Example

let mut memory = memory::Memory::new();
let mut registers = registers::Registers::default();

evaluate!(
  &mut memory,
  &mut registers,
  LDA(Immediate(0)),  // LDA #$0
  ADC(Immediate(5)),  // ADC #$5
  ASL(Accumulator),   // ASL A
  TAX,                // TAX
  STX(Absolute(100)), // STX $100
  LDX(Immediate(1)),  // LDX #$1
  // LDY(AbsoluteY(99)), // LDY $99,Y (This results in a compilation error,
  //                     //            as this is an invalid instruction.)
  LDY(AbsoluteX(99)), // LDY $99,X
  INY                 // INY
);

println!("{}", registers);

TODO

  • Memory Access
  • Registers
  • Basic Instructions
  • Stack Instructions
  • Branch Instructions
  • Flags
  • Binary Mode (Not required)