lc3_vm 0.1.0

LC-3 (Little Computer 3) VM implemented in Rust. Ideally, it will run any LC-3 assembly program.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use crate::hardware::register::condition_flag;
use crate::hardware::register::Registers;

/// The bit-wise complement of the contents of SR is stored in DR.
/// The condi- tion codes are set, based on whether the binary value produced,
/// taken as a 2’s complement integer, is negative, zero, or positive.
pub fn not(instr: u16, registers: &mut Registers) {
    let dr = (instr >> 9) & 0x7;
    let sr1 = (instr >> 6) & 0x7;
    registers.update(dr, !registers.get(sr1));

    condition_flag::update_r_cond_register(dr, registers);
}