@@ -5,7 +5,7 @@ use std::num::{FromPrimitive, ToPrimitive};
5
5
/// A register index/name
6
6
///
7
7
/// There are 16 data registers, `V0`..`VF`
8
- #[ derive( FromPrimitive , Copy , Debug ) ]
8
+ #[ derive( FromPrimitive , Clone , Copy , Debug ) ]
9
9
pub enum Register {
10
10
V0 = 0x0 ,
11
11
V1 = 0x1 ,
@@ -48,7 +48,7 @@ pub type Byte = u8;
48
48
/// A nibble (hex digit)
49
49
///
50
50
/// Valid values are within `0x0` .. `0xF`.
51
- #[ derive( Copy , Debug ) ]
51
+ #[ derive( Clone , Copy , Debug ) ]
52
52
pub struct Nibble {
53
53
pub bits : u8 ,
54
54
}
@@ -63,7 +63,7 @@ impl Nibble {
63
63
/// Absolute memory address
64
64
///
65
65
/// Valid addresses are within `0x0` .. `0xFFF`.
66
- #[ derive( Copy , Debug ) ]
66
+ #[ derive( Clone , Copy , Debug ) ]
67
67
pub struct Addr {
68
68
pub bits : u16 ,
69
69
}
@@ -79,7 +79,7 @@ impl Addr {
79
79
/// Raw instruction
80
80
///
81
81
/// Helper around the raw bits, not necessarily a valid instruction.
82
- #[ derive( Copy ) ]
82
+ #[ derive( Clone , Copy ) ]
83
83
pub struct RawInstruction {
84
84
bits : u16
85
85
}
@@ -130,7 +130,7 @@ impl RawInstruction {
130
130
/// High-level instruction
131
131
///
132
132
/// A valid instruction that can be executed as-is.
133
- #[ derive( Copy , Debug ) ]
133
+ #[ derive( Clone , Copy , Debug ) ]
134
134
pub enum Instruction {
135
135
/// Jumps to machine subroutine at `Addr`.
136
136
///
0 commit comments