From 6839781fa0b9dfd5adea4d0e666c8afa86a89add Mon Sep 17 00:00:00 2001 From: Kacper Date: Wed, 10 Jun 2020 13:00:40 +0100 Subject: [PATCH] Added STR and LDR to the cpp generator --- InstructionGenerator.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/InstructionGenerator.cpp b/InstructionGenerator.cpp index 05a70b5..b158f3d 100644 --- a/InstructionGenerator.cpp +++ b/InstructionGenerator.cpp @@ -254,6 +254,12 @@ string getInstructionHex(string instruction){ binary+="101001"; rs1="R0"; rs2="R0"; + }else if(opcode=="LDR"){ + binary+="101010"; + rs2="R0"; + }else if(opcode=="STR"){ + binary+="101011"; + rs2="R0"; }else if(opcode=="NOP"){ binary+="111110"; rd="R0";