fix instruction.rs

This commit is contained in:
Denis-Cosmin NUTIU 2024-12-01 23:10:39 +02:00
parent fba4c9e5e7
commit d8e221e05a

View file

@ -1,4 +1,5 @@
use std::fmt::{Display, Formatter, Write}; use std::fmt;
use std::fmt::{Display, Formatter, LowerHex};
#[derive(Debug)] #[derive(Debug)]
pub struct Instruction { pub struct Instruction {
@ -9,7 +10,7 @@ impl Instruction {
/// Creates a new instruction instance. /// Creates a new instruction instance.
pub(crate) fn new(data: [u8; 2]) -> Self { pub(crate) fn new(data: [u8; 2]) -> Self {
Instruction { Instruction {
data: (data[1] as u16) << 8u8 | (data[0] as u16), data: (data[0] as u16) << 8u8 | (data[1] as u16),
} }
} }
} }