summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/cpu8051.rs8
-rw-r--r--src/main.rs6
-rw-r--r--src/ram.rs4
3 files changed, 9 insertions, 9 deletions
diff --git a/src/cpu8051.rs b/src/cpu8051.rs
index 8702484..c76e9b6 100644
--- a/src/cpu8051.rs
+++ b/src/cpu8051.rs
@@ -4,9 +4,9 @@ use super::ram::Ram;
use super::ram::RAM_OFFSET_ACC;
use super::ram::RAM_OFFSET_SP;
+use std::cell::RefCell;
use std::fmt;
use std::rc::Rc;
-use std::cell::RefCell;
#[derive(Debug, Clone, Copy)]
pub enum Opname {
@@ -486,7 +486,9 @@ impl Cpu8051 {
fn fetch_operand(&self, operand: IncompleteOperand, offset: u16) -> Operand {
match operand {
IncompleteOperand::Acc => Operand::Acc,
- IncompleteOperand::Direct => Operand::Direct(self.progmem.borrow().get(self.pc + offset)),
+ IncompleteOperand::Direct => {
+ Operand::Direct(self.progmem.borrow().get(self.pc + offset))
+ }
IncompleteOperand::Data => Operand::Data(self.progmem.borrow().get(self.pc + offset)),
IncompleteOperand::Data16 => Operand::Data16({
let high = self.progmem.borrow().get(self.pc + offset);
@@ -586,7 +588,7 @@ impl Cpu8051 {
other
),
};
- self.extmem.borrow_mut().set(dest as u16 ,value);
+ self.extmem.borrow_mut().set(dest as u16, value);
}
fn push(&mut self, operand: Operand) {
diff --git a/src/main.rs b/src/main.rs
index 5aa3307..cc5b707 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,16 +1,16 @@
extern crate clap;
+use std::cell::RefCell;
use std::fs;
use std::io;
use std::io::prelude::*;
+use std::rc::Rc;
use std::sync::mpsc::{channel, Receiver, Sender};
use std::thread;
use std::time::Duration;
-use std::rc::Rc;
-use std::cell::RefCell;
-mod cpu8051;
mod bus;
+mod cpu8051;
mod progmem;
mod ram;
diff --git a/src/ram.rs b/src/ram.rs
index 7027a0e..6278b1c 100644
--- a/src/ram.rs
+++ b/src/ram.rs
@@ -33,9 +33,7 @@ impl Ram {
let mut array = [0; u8::max_value() as usize + 1];
array[RAM_OFFSET_SP as usize] = RESET_VALUE_SP;
array[RAM_OFFSET_ACC as usize] = RESET_VALUE_ACC;
- Self {
- array,
- }
+ Self { array }
}
}