summaryrefslogtreecommitdiff
path: root/src/processor/registers.rs
blob: a23cd925b8101e80239c127f8d5d3c5d86b7fe2b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
pub struct CSPR {
    n: bool,
    z: bool,
    c: bool,
    v: bool,
}

impl CSPR {
    pub fn new() -> Self {
        CSPR {
            n: false,
            z: false,
            c: false,
            v: false,
        }
    }
}

pub struct Registers {
    pub r : [i32; 12],
    ip: i32,
    sp: i32,
    lr: i32,
    pc: u32,
    nzcv: CSPR,
}

impl Registers {
    pub fn new() -> Self {
        Registers {
            r: [0; 12],
            ip: 0,
            sp: 0,
            lr: 0,
            pc: 0,
            nzcv: CSPR::new(),
        }
    }
}