mirror of
https://github.com/mre/mos6502.git
synced 2024-11-25 02:33:26 +00:00
return comments
This commit is contained in:
parent
71ac36b083
commit
c837d7c986
@ -27,12 +27,19 @@
|
||||
|
||||
extern crate mos6502;
|
||||
|
||||
#[cfg(not(test))]
|
||||
use mos6502::cpu;
|
||||
|
||||
#[cfg(not(test))]
|
||||
use mos6502::address::Address;
|
||||
|
||||
#[cfg(not(test))]
|
||||
fn main() {
|
||||
let mut cpu = cpu::CPU::new();
|
||||
|
||||
// "Load" a program
|
||||
|
||||
|
||||
let zero_page_data = [
|
||||
// ZeroPage data start
|
||||
0x00,
|
||||
@ -91,7 +98,7 @@ fn main() {
|
||||
0xFF, // Something invalid -- the end!
|
||||
];
|
||||
|
||||
let data: [u8; 25] = [
|
||||
let data = [
|
||||
0x00,
|
||||
0x09, // ADC Absolute target
|
||||
0x00,
|
||||
@ -119,7 +126,6 @@ fn main() {
|
||||
0x06, // ADC IndirectIndexedY target
|
||||
];
|
||||
|
||||
// "Load" a program
|
||||
cpu.memory.set_bytes(Address(0x0000), &zero_page_data);
|
||||
cpu.memory.set_bytes(Address(0x4000), &program);
|
||||
cpu.memory.set_bytes(Address(0x8000), &data);
|
||||
@ -127,4 +133,6 @@ fn main() {
|
||||
cpu.registers.program_counter = Address(0x4000);
|
||||
|
||||
cpu.run();
|
||||
|
||||
println!("{:?}", cpu);
|
||||
}
|
Loading…
Reference in New Issue
Block a user