From fb4883b84033059588b3a21c2f287c07d97e2e0e Mon Sep 17 00:00:00 2001 From: Persson-dev Date: Fri, 6 Dec 2024 16:35:10 +0100 Subject: [PATCH] add unused byte for easier reading in cpu --- src/Assembleur.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Assembleur.cpp b/src/Assembleur.cpp index 17ce3fd..728b09c 100644 --- a/src/Assembleur.cpp +++ b/src/Assembleur.cpp @@ -80,11 +80,11 @@ std::uint32_t Assembleur::ParseOperationImmediate( } std::uint32_t Assembleur::ParseJump(Instruction a_Instruction, const std::string& a_Label) { - return IToInt(a_Instruction) | ParseLabel(a_Label); + return IToInt(a_Instruction) | ParseLabel(a_Label) & 0x3FFFFFF; } std::uint32_t Assembleur::ParseJump(Instruction a_Instruction, std::uint8_t a_R1, std::uint8_t a_R2, const std::string& a_Label) { - return IToInt(a_Instruction) | a_R1 << 24 | a_R2 << 21 | ParseLabel(a_Label); + return IToInt(a_Instruction) | a_R1 << 23 | a_R2 << 20 | ParseLabel(a_Label) & 0xFFFFF; } std::uint32_t Assembleur::ParseJump(Instruction a_Instruction) { @@ -92,7 +92,7 @@ std::uint32_t Assembleur::ParseJump(Instruction a_Instruction) { } std::uint32_t Assembleur::ParseIO(Instruction a_Instruction, std::uint32_t a_R1, std::uint32_t a_R2, std::uint32_t a_R3) { - return IToInt(a_Instruction) | a_R1 << 24 | a_R2 << 21 | a_R3 << 18; + return IToInt(a_Instruction) | a_R1 << 23 | a_R2 << 20 | a_R3 << 17; }