Initial commit

This commit is contained in:
2024-02-05 09:05:48 +02:00
commit a005400477
43 changed files with 685 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
#[derive(Clone, Debug)]
pub struct Instruction {
pub name: String,
pub arg: String,
pub data: u16
}
#[derive(Clone, Debug)]
pub struct Stack {
pub program: Vec<Instruction>,
pub program_counter: u16,
pub labels: [Option<i16>; 256],
pub memory: Vec<u16>
}
impl Stack {
pub fn new() -> Stack {
return Stack {
program: Vec::new(),
program_counter: 0,
labels: [None; 256],
memory: Vec::new()
};
}
}