Skip to content

Commit

Permalink
spacing fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jamorton committed Apr 5, 2012
1 parent 173a745 commit 9635215
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions emu.rs
Expand Up @@ -100,11 +100,11 @@ fn new_value(cpu: cpu_state, key: u16) -> value {

fn get_value(cpu: cpu_state, v: value) -> u16 {
alt v {
value_reg(t) { cpu.regs[t] }
value_mem(t) { cpu.mem[t] }
value_sp { cpu.sp }
value_pc { cpu.pc }
value_o { cpu.o }
value_reg(t) { cpu.regs[t] }
value_mem(t) { cpu.mem[t] }
value_sp { cpu.sp }
value_pc { cpu.pc }
value_o { cpu.o }
value_literal(t) { t }
}
}
Expand All @@ -113,22 +113,22 @@ fn set_value(cpu: cpu_state, targ: value, v: u16) {
alt targ {
value_reg(t) { cpu.regs[t] = v; }
value_mem(t) { cpu.mem[t] = v; }
value_sp { cpu.sp = v; }
value_pc { cpu.pc = v; }
value_o { cpu.o = v; }
value_sp { cpu.sp = v; }
value_pc { cpu.pc = v; }
value_o { cpu.o = v; }
value_literal(t) { error("set_val: attempt to set a literal"); }
}
}

fn step(cpu: cpu_state) {

let word = next_pc(cpu);
let op = basic_op((word & 0b0000000000001111u16) as uint);
let op = basic_op((word & 0b0000000000001111u16) as uint);
let av = new_value(cpu, (word & 0b0000001111110000u16) >> 4u16);
let bv = new_value(cpu, (word & 0b1111110000000000u16) >> 10u16);

let a = get_value(cpu, av) as uint;
let b = get_value(cpu, bv) as uint;
let a = get_value(cpu, av) as uint;
let b = get_value(cpu, bv) as uint;

// Non-basic instructions
if op == NBI {
Expand Down

0 comments on commit 9635215

Please sign in to comment.