From 89aaa4e821da2a88f86eb4e5706d913c401e94b3 Mon Sep 17 00:00:00 2001 From: Samy Solhi Date: Tue, 7 Feb 2023 22:00:53 +0100 Subject: [PATCH] Changed hexa format to lowercase --- src/simulator/print.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/simulator/print.rs b/src/simulator/print.rs index a76fbd6..e6d5a54 100644 --- a/src/simulator/print.rs +++ b/src/simulator/print.rs @@ -68,13 +68,13 @@ pub fn print(ins: Instruction, pc: i32) -> String { //TODO pc should be u64 } }, RISCV_LUI => { - format!("lui\t{}, 0x{:X}", REG_X[rd], ins.imm31_12) + format!("lui\t{}, 0x{:x}", REG_X[rd], ins.imm31_12) }, RISCV_AUIPC => { - format!("auipc\t{}, {:X}", REG_X[rd], ins.imm31_12) + format!("auipc\t{}, {:x}", REG_X[rd], ins.imm31_12) }, RISCV_JAL => { - format!("jal\t{},{:X}", REG_X[rd], (pc + ins.imm21_1_signed)) + format!("jal\t{},{:x}", REG_X[rd], (pc + ins.imm21_1_signed)) }, RISCV_JALR => { format!("jalr\t{},{}({})", REG_X[rd], ins.imm12_I_signed, REG_X[rs1]) @@ -174,8 +174,8 @@ mod test { fn test_lui() { let lui = decode::decode(0b01110001000011111000_11100_0110111); let lui_negatif = decode::decode(0b11110001000011111000_11100_0110111); - assert_eq!("lui\tt3, 0x710F8000", print::print(lui, 0)); - assert_eq!("lui\tt3, 0xF10F8000", print::print(lui_negatif, 0)); + assert_eq!("lui\tt3, 0x710f8000", print::print(lui, 0)); + assert_eq!("lui\tt3, 0xf10f8000", print::print(lui_negatif, 0)); } #[test]