embive 0.7.1

Embive is an interpreter/virtual-machine that leverages RISC-V bytecode, enabling sandboxed code execution on tiny devices (e.g. microcontrollers).
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::format::{Format, TypeI};
use crate::instruction::{embive, riscv};
use crate::transpiler::Error;

use super::{embive_raw, Convert, RawInstruction};

impl Convert for riscv::MiscMem {
    fn convert(data: u32) -> Result<RawInstruction, Error> {
        let mut inst = TypeI::from_riscv(data);
        inst.func = embive::SystemMiscMem::MISC_FUNC;
        inst.imm = embive::SystemMiscMem::FENCEI_IMM;

        Ok(embive_raw!(embive::SystemMiscMem, inst))
    }
}