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
//! # Uxn stack machine
//! Represents a fully functional [Uxn stack-machine](https://wiki.xxiivv.com/site/uxn.html).
//!
//! Execution of code is done using the [`UxnVector`](crate::UxnVector) abstraction. It is an iterator
//! requiring a starting address. It then runs until encountering a `BRK` instruction.
//! Using iterators eases up the interaction.
//! ```rust
//! # use baryuxn::*;
//! # struct NullDevices;
//! # impl UxnDeviceBus for NullDevices {
//! # fn read(&mut self, _machine: &mut UxnMachineState, _address: u8) -> u8 { 0 }
//! # fn write(&mut self, _machine: &mut UxnMachineState, _address: u8, _byte: u8) {}
//! # }
//! # fn main() {
//! # let mut mem = [0; 0x10000];
//! # let mut dev = NullDevices;
//!
//! # let mut machine = UxnMachineState::new();
//! for (opcode, pc) in UxnVector::new(0x100, &mut machine, &mut mem, &mut dev) {
//! println!("{pc}: {opcode}");
//! }
//! # }
//! ```
use crateUxnStack;
/// The Uxn machine, able to execute [Uxntal instructions](https://wiki.xxiivv.com/site/uxntal_opcodes.html).