forked from n3tael/labast
13 lines
241 B
Rust
13 lines
241 B
Rust
use crate::errors::RunError;
|
|
|
|
pub fn not(memory: &mut Vec<u16>) {
|
|
let a: bool = memory.pop().expect(&format!("{}", RunError::MemoryEmpty)) == 1;
|
|
|
|
let c: u16 = if !a {
|
|
1
|
|
} else {
|
|
0
|
|
};
|
|
|
|
memory.push(c);
|
|
} |