Implement ADD and JUMP instructions
This commit is contained in:
@@ -9,6 +9,17 @@ pub enum Instruction {
|
||||
JUMP { offset: i16, count: u16 },
|
||||
MOV { src: File, dst: File },
|
||||
FILL { src: File, dst: File },
|
||||
ADD { src0: File, src1: File, dst: File },
|
||||
}
|
||||
|
||||
impl Instruction {
|
||||
pub fn supported_source(&self, src: File) -> bool {
|
||||
true
|
||||
}
|
||||
|
||||
pub fn supported_destination(&self, src: File) -> bool {
|
||||
true
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||
@@ -19,7 +30,7 @@ pub enum File {
|
||||
Bank,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Kernel(pub [Instruction; 32]);
|
||||
|
||||
impl Kernel {
|
||||
@@ -32,7 +43,7 @@ pub struct PimConfig {
|
||||
pub kernel: Kernel,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, Copy, Serialize, Deserialize)]
|
||||
pub enum BankMode {
|
||||
SingleBank,
|
||||
AllBank,
|
||||
|
||||
Reference in New Issue
Block a user