Dekejit/src/lib.rs

23 lines
401 B
Rust
Raw Normal View History

2023-04-28 12:18:07 +02:00
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);
}
}