1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#[cfg(target_arch = "arm")]
#[macro_export]
macro_rules! primitive {
    (fn $args:tt) => { fn $args };
    (fn $f:ident $args:tt $body:tt) => { fn $f $args $body };
    (fn $f:ident $args:tt -> isize $body:tt) => { fn $f $args -> isize $body };
    (fn $f:ident $args:tt -> &mut [usize; 2] $body:tt) => { fn $f $args -> &mut [usize; 2] $body };
}

#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
#[macro_export]
macro_rules! primitive {
    (fn $args:tt) => { extern "fastcall" fn $args };
    (fn $f:ident $args:tt $body:tt) => { extern "fastcall" fn $f $args $body };
    (fn $f:ident $args:tt -> isize $body:tt) => { extern "fastcall" fn $f $args -> isize $body };
    (fn $f:ident $args:tt -> &mut [usize; 2] $body:tt)
        => { extern "fastcall" fn $f $args -> &mut [usize; 2] $body };
}

#[macro_use]
extern crate approx;
extern crate hibitset;
extern crate uom;

pub mod core;
pub mod env;
pub mod exception;
pub mod facility;
pub mod file_access;
pub mod float;
pub mod loader;
pub mod memory;
pub mod mock_vm;
pub mod output;
pub(crate) mod parser;
pub mod tools;
pub mod units;

use core::Core;
use memory::Memory;
use std::result;

pub const TRUE: isize = -1;
pub const FALSE: isize = 0;
pub const NUM_TASKS: usize = 8;

pub type Result = result::Result<(), isize>;