]> Witch of Git - jade-rose/blob - toolchain/src/bin/disassembler.rs
Add disassembler, update spec
[jade-rose] / toolchain / src / bin / disassembler.rs
1 use std::io;
2 use toolchain::{inst::decode::Decode, Inst};
3
4 fn main() {
5 let stdin = io::stdin();
6 let mut input = stdin.lock();
7 loop {
8 match Inst::decode(&mut input) {
9 Ok(inst) => println!("{}", inst),
10 Err(err) if err.kind() == io::ErrorKind::UnexpectedEof => break,
11 Err(err) => println!("Error: {}", err),
12 }
13 }
14 }