2023-04-28 12:18:07 +02:00
|
|
|
use std::mem::transmute;
|
|
|
|
|
|
|
|
pub mod cpu;
|
|
|
|
pub mod jit;
|
|
|
|
pub mod loader;
|
2023-05-03 08:40:47 +02:00
|
|
|
pub mod cli;
|
2023-04-28 12:18:07 +02:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|