forked from n3tael/labast
Initial commit
This commit is contained in:
@@ -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()
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user