From 7f9fb76513d3c8b2ac77f6d073e2a98e726e1529 Mon Sep 17 00:00:00 2001 From: Baptiste Date: Wed, 26 Oct 2022 15:06:37 +0200 Subject: [PATCH] import Instruction and use print in main --- src/main.rs | 3 ++- src/print.rs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 16cda16..aefc218 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,7 @@ mod decode; +mod print; fn main() { let instr = decode::decode(98); - println!("Hello, world! opcode : {}", instr.opcode); + println!("{}", print::print(instr, 0)); } diff --git a/src/print.rs b/src/print.rs index 65ef08f..c2e2e47 100644 --- a/src/print.rs +++ b/src/print.rs @@ -1,4 +1,4 @@ -mod decode.rs +use crate::decode::Instruction; const RISCV_LUI: u8 = 0x37; const RISCV_AUIPC: u8 = 0x17;