mirror of
https://github.com/guilhermewerner/machine
synced 2025-06-16 05:04:18 +00:00
Merge branch 'dev' of https://github.com/GuilhermeWerner/Machine into dev
This commit is contained in:
@ -14,7 +14,6 @@ path = "Source/lib.rs"
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
bincode = "1.3.3"
|
bincode = "1.3.3"
|
||||||
bitflags = "1.3.2"
|
|
||||||
serde = { version = "1.0", features = ["derive"] }
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
|
|
||||||
[[example]]
|
[[example]]
|
||||||
|
@ -1,27 +0,0 @@
|
|||||||
#![allow(non_snake_case)]
|
|
||||||
|
|
||||||
use ::Machine::*;
|
|
||||||
use bincode::Options;
|
|
||||||
use std::fs;
|
|
||||||
|
|
||||||
fn main() {
|
|
||||||
let assembly = Assembly {
|
|
||||||
name: "Serialization Example".into(),
|
|
||||||
version: 1,
|
|
||||||
source: AssemblySource {
|
|
||||||
text: include_bytes!("Bytecode.bin").to_vec(),
|
|
||||||
data: Vec::new(),
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
let options = bincode::options()
|
|
||||||
.with_big_endian()
|
|
||||||
.with_fixint_encoding()
|
|
||||||
.allow_trailing_bytes();
|
|
||||||
|
|
||||||
let encoded: Vec<u8> = options.serialize(&assembly).unwrap();
|
|
||||||
fs::write("Examples/Assembly.bin", &encoded).unwrap();
|
|
||||||
|
|
||||||
//let decoded: Assembly = bincode::deserialize(&encoded[..]).unwrap();
|
|
||||||
//assert_eq!(assembly, decoded);
|
|
||||||
}
|
|
Binary file not shown.
@ -1,21 +0,0 @@
|
|||||||
#![allow(non_snake_case)]
|
|
||||||
|
|
||||||
use ::Machine::*;
|
|
||||||
use bincode::Options;
|
|
||||||
use std::fs;
|
|
||||||
|
|
||||||
fn main() {
|
|
||||||
let encoded: Vec<u8> = fs::read("Examples/Assembly.bin").unwrap();
|
|
||||||
|
|
||||||
let options = bincode::options()
|
|
||||||
.with_big_endian()
|
|
||||||
.with_fixint_encoding()
|
|
||||||
.allow_trailing_bytes();
|
|
||||||
|
|
||||||
let assembly: Assembly = options.deserialize(&encoded[..]).unwrap();
|
|
||||||
|
|
||||||
let mut vm = Machine::New([0, 0, 0, 0]);
|
|
||||||
|
|
||||||
vm.LoadProgram(&assembly.source.text);
|
|
||||||
vm.Execute();
|
|
||||||
}
|
|
@ -1,23 +0,0 @@
|
|||||||
use serde::{Deserialize, Serialize};
|
|
||||||
use std::borrow::Cow;
|
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Serialize, Deserialize)]
|
|
||||||
pub struct Assembly {
|
|
||||||
/// Assembly name.
|
|
||||||
pub name: Cow<'static, str>,
|
|
||||||
|
|
||||||
/// Assembly version.
|
|
||||||
pub version: u8,
|
|
||||||
|
|
||||||
/// Assembly bytecode source.
|
|
||||||
pub source: AssemblySource,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Serialize, Deserialize)]
|
|
||||||
pub struct AssemblySource {
|
|
||||||
/// Source instructions.
|
|
||||||
pub text: Vec<u8>,
|
|
||||||
|
|
||||||
/// Statics and embed data.
|
|
||||||
pub data: Vec<u8>,
|
|
||||||
}
|
|
@ -1,4 +1,4 @@
|
|||||||
use crate::Types::*;
|
use crate::{Byte, DWord, Half, QWord, Word};
|
||||||
use std::mem;
|
use std::mem;
|
||||||
|
|
||||||
pub struct Heap {
|
pub struct Heap {
|
||||||
|
@ -1,28 +0,0 @@
|
|||||||
use crate::Types::Byte;
|
|
||||||
use crate::{Machine, PayloadType};
|
|
||||||
|
|
||||||
pub struct Instruction {
|
|
||||||
pub code: Byte,
|
|
||||||
pub name: String,
|
|
||||||
pub payload: PayloadType,
|
|
||||||
pub function: InstructionFunction,
|
|
||||||
}
|
|
||||||
|
|
||||||
pub type InstructionFunction = fn(machine: &mut Machine) -> bool;
|
|
||||||
|
|
||||||
impl Instruction {
|
|
||||||
#[inline]
|
|
||||||
pub fn New(
|
|
||||||
code: Byte,
|
|
||||||
name: &str,
|
|
||||||
payload: PayloadType,
|
|
||||||
function: InstructionFunction,
|
|
||||||
) -> Self {
|
|
||||||
Self {
|
|
||||||
code,
|
|
||||||
name: name.to_string(),
|
|
||||||
payload,
|
|
||||||
function,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,180 +0,0 @@
|
|||||||
use crate::Instructions::*;
|
|
||||||
use crate::Operations::*;
|
|
||||||
use crate::Types::Byte;
|
|
||||||
use crate::{Instruction, PayloadType};
|
|
||||||
use std::collections::HashMap;
|
|
||||||
|
|
||||||
pub struct InstructionTable {
|
|
||||||
table: HashMap<Byte, Instruction>,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Default for InstructionTable {
|
|
||||||
fn default() -> Self {
|
|
||||||
Self {
|
|
||||||
table: HashMap::new(),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl InstructionTable {
|
|
||||||
#[inline]
|
|
||||||
#[rustfmt::skip]
|
|
||||||
pub fn New() -> Self {
|
|
||||||
let mut table = InstructionTable::default();
|
|
||||||
|
|
||||||
table.Insert(Instruction::New(NOP, "nop",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(LDR_B, "ldr b",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(LDR_H, "ldr h",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(LDR_W, "ldr w",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(LDR_D, "ldr d",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(LDR_Q, "ldr q",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(LDA_B, "lda b",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(LDA_H, "lda h",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(LDA_W, "lda w",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(LDA_D, "lda d",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(LDA_Q, "lda q",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(LDI_B, "ldi b",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(LDI_H, "ldi h",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(LDI_W, "ldi w",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(LDI_D, "ldi d",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(LDI_Q, "ldi q",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(STR_B, "str b",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(STR_H, "str h",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(STR_W, "str w",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(STR_D, "str d",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(STR_Q, "str q",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(STA_B, "sta b",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(STA_H, "sta h",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(STA_W, "sta w",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(STA_D, "sta d",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(STA_Q, "sta q",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(STI_B, "sti b",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(STI_H, "sti h",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(STI_W, "sti w",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(STI_D, "sti d",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(STI_Q, "sti q",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(INC, "inc",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(DEC, "dec",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(MOV, "mov",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(SWP, "swp",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(JMP, "jmp",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(JMZ, "jmz",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(JEQ, "jeq",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(JNE, "jne",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(JLT, "jlt",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(JLE, "jle",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(JGT, "jgt",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(JGE, "jge",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(CALL, "all",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(RET, "ret",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(PUSH_B, "ush b",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(PUSH_H, "ush h",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(PUSH_W, "ush w",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(PUSH_D, "ush d",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(PUSH_Q, "ush q",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(PEEK_B, "eek b",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(PEEK_H, "eek h",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(PEEK_W, "eek w",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(PEEK_D, "eek d",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(PEEK_Q, "eek q",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(POP_B, "pop b",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(POP_H, "pop h",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(POP_W, "pop w",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(POP_D, "pop d",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(POP_Q, "pop q",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(NEG, "neg",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(ADD_U8, "add u8",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(ADD_U16, "add u16",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(ADD_U32, "add u32",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(ADD_U64, "add u64",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(ADD_U128, "add u128",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(ADD_I8, "add i8",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(ADD_I16, "add i16",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(ADD_I32, "add i32",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(ADD_I64, "add i64",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(ADD_I128, "add i128",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(ADD_F32, "add f32",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(ADD_F64, "add f64",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(SUB_U8, "sub u8",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(SUB_U16, "sub u16",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(SUB_U32, "sub u32",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(SUB_U64, "sub u64",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(SUB_U128, "sub u128",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(SUB_I8, "sub i8",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(SUB_I16, "sub i16",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(SUB_I32, "sub i32",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(SUB_I64, "sub i64",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(SUB_I128, "sub i128",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(SUB_F32, "sub f32",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(SUB_F64, "sub f64",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(MUL_U8, "mul u8",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(MUL_U16, "mul u16",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(MUL_U32, "mul u32",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(MUL_U64, "mul u64",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(MUL_U128, "mul u128",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(MUL_I8, "mul i8",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(MUL_I16, "mul i16",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(MUL_I32, "mul i32",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(MUL_I64, "mul i64",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(MUL_I128, "mul i128",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(MUL_F32, "mul f32",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(MUL_F64, "mul f64",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(DIV_U8, "div u8",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(DIV_U16, "div u16",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(DIV_U32, "div u32",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(DIV_U64, "div u64",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(DIV_U128, "div u128",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(DIV_I8, "div i8",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(DIV_I16, "div i16",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(DIV_I32, "div i32",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(DIV_I64, "div i64",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(DIV_I128, "div i128",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(DIV_F32, "div f32",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(DIV_F64, "div f64",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(REM_U8, "rem u8",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(REM_U16, "rem u16",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(REM_U32, "rem u32",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(REM_U64, "rem u64",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(REM_U128, "rem u128",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(REM_I8, "rem i8",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(REM_I16, "rem i16",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(REM_I32, "rem i32",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(REM_I64, "rem i64",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(REM_I128, "rem i128",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(REM_F32, "rem f32",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(REM_F64, "rem f64",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(AND, "and",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(OR, " or",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(XOR, "xor",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(NOT, "not",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(NAND, "and",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(NOR, "nor",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(XNOR, "nor",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(SHL, "shl",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(SHR, "shr",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(EQ, " eq",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(NE, " ne",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(LT, " lt",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(LE, " le",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(GT, " gt",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(GE, " ge",PayloadType::Nothing, Nothing));
|
|
||||||
table.Insert(Instruction::New(HLT, "hlt",PayloadType::Nothing, Nothing));
|
|
||||||
|
|
||||||
table
|
|
||||||
}
|
|
||||||
|
|
||||||
#[inline]
|
|
||||||
pub fn IsEmpty(&self) -> bool {
|
|
||||||
self.table.is_empty()
|
|
||||||
}
|
|
||||||
|
|
||||||
#[inline]
|
|
||||||
pub fn Get(&self, code: Byte) -> Option<&Instruction> {
|
|
||||||
self.table.get(&code)
|
|
||||||
}
|
|
||||||
|
|
||||||
#[inline]
|
|
||||||
pub fn Insert(&mut self, instruction: Instruction) {
|
|
||||||
self.table.insert(instruction.code, instruction);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,3 +1,3 @@
|
|||||||
pub const REGISTER_COUNT: usize = 16;
|
pub const REGISTER_COUNT: usize = 16;
|
||||||
pub const STACK_SIZE: usize = 64;
|
pub const STACK_SIZE: usize = 512;
|
||||||
pub const HEAP_LIMIT: usize = 256;
|
pub const HEAP_LIMIT: usize = 4096;
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
use crate::Instructions::*;
|
use crate::Instructions::*;
|
||||||
use crate::Operations::*;
|
use crate::Operations::*;
|
||||||
use crate::Types::*;
|
use crate::{Byte, Half, Heap, Registry, Stack, Word, HEAP_LIMIT, STACK_SIZE};
|
||||||
use crate::{Heap, Registry, Stack, HEAP_LIMIT, STACK_SIZE};
|
|
||||||
|
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
pub struct Machine {
|
pub struct Machine {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
use crate::Machine;
|
use crate::Machine;
|
||||||
use crate::Types::{Byte, Word};
|
use crate::{Byte, Word};
|
||||||
|
|
||||||
pub type Register = Byte;
|
pub type Register = Byte;
|
||||||
pub type RegisterAddress = (Byte, Word);
|
pub type RegisterAddress = (Byte, Word);
|
||||||
|
@ -1,10 +0,0 @@
|
|||||||
|
|
||||||
pub enum PayloadType {
|
|
||||||
Nothing,
|
|
||||||
Register,
|
|
||||||
RegisterAddress,
|
|
||||||
AddressRegister,
|
|
||||||
TwoRegisters,
|
|
||||||
ThreeRegisters,
|
|
||||||
FourRegisters,
|
|
||||||
}
|
|
@ -1,4 +1,4 @@
|
|||||||
use crate::Types::*;
|
use crate::Word;
|
||||||
use crate::REGISTER_COUNT;
|
use crate::REGISTER_COUNT;
|
||||||
|
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::Types::*;
|
use crate::{Byte, DWord, QWord, Half,Word};
|
||||||
use std::mem;
|
use std::mem;
|
||||||
|
|
||||||
pub struct Stack {
|
pub struct Stack {
|
||||||
|
@ -5,11 +5,6 @@ mod Instructions;
|
|||||||
|
|
||||||
pub mod Operations;
|
pub mod Operations;
|
||||||
pub mod Payload;
|
pub mod Payload;
|
||||||
pub mod Types;
|
|
||||||
|
|
||||||
#[path = "Assembly.rs"]
|
|
||||||
mod _Assembly;
|
|
||||||
pub use self::_Assembly::*;
|
|
||||||
|
|
||||||
#[path = "Heap.rs"]
|
#[path = "Heap.rs"]
|
||||||
mod _Heap;
|
mod _Heap;
|
||||||
@ -23,10 +18,6 @@ pub use self::_Limits::*;
|
|||||||
mod _Machine;
|
mod _Machine;
|
||||||
pub use self::_Machine::*;
|
pub use self::_Machine::*;
|
||||||
|
|
||||||
#[path = "PayloadType.rs"]
|
|
||||||
mod _PayloadType;
|
|
||||||
pub use self::_PayloadType::*;
|
|
||||||
|
|
||||||
#[path = "Registry.rs"]
|
#[path = "Registry.rs"]
|
||||||
mod _Registry;
|
mod _Registry;
|
||||||
pub use self::_Registry::*;
|
pub use self::_Registry::*;
|
||||||
@ -35,10 +26,6 @@ pub use self::_Registry::*;
|
|||||||
mod _Stack;
|
mod _Stack;
|
||||||
pub use self::_Stack::*;
|
pub use self::_Stack::*;
|
||||||
|
|
||||||
#[path = "Instruction.rs"]
|
#[path = "Types.rs"]
|
||||||
mod _Instruction;
|
mod _Types;
|
||||||
pub use self::_Instruction::*;
|
pub use self::_Types::*;
|
||||||
|
|
||||||
#[path = "InstructionTable.rs"]
|
|
||||||
mod _InstructionTable;
|
|
||||||
pub use self::_InstructionTable::*;
|
|
||||||
|
Reference in New Issue
Block a user