Dekejit/src/lib.rs

23 lines
402 B
Rust

use std::mem::transmute;
pub mod cpu;
pub mod jit;
pub mod loader;
// pub mod ;
pub mod assembler;
//
pub fn interpret_as_signed(x: u16) -> i16 {
// the two types have the same size.
unsafe {
return transmute::<u16, i16>(x);
}
}
pub fn interpret_as_unsigned(x: i16) -> u16 {
// the two types have the same size.
unsafe {
return transmute::<i16, u16>(x);
}
}