forked from n3tael/labast
9 lines
263 B
Rust
9 lines
263 B
Rust
use crate::errors::RunError;
|
|
|
|
pub fn swap(memory: &mut Vec<u16>) {
|
|
let a: u16 = memory.pop().expect(&format!("{}", RunError::MemoryEmpty));
|
|
let b: u16 = memory.pop().expect(&format!("{}", RunError::MemoryEmpty));
|
|
|
|
memory.push(a);
|
|
memory.push(b);
|
|
} |