From 0b1ffea9ce36fc2d2e9827810636e1dcf7bdd1cf Mon Sep 17 00:00:00 2001 From: Kacper Date: Sun, 7 Jun 2020 17:10:37 +0100 Subject: [PATCH] Updated instruction generator to include new opcodes --- InstructionGenerator.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/InstructionGenerator.cpp b/InstructionGenerator.cpp index 90abdad..540e3a2 100644 --- a/InstructionGenerator.cpp +++ b/InstructionGenerator.cpp @@ -229,10 +229,9 @@ string getInstructionHex(string instruction){ }else if(opcode=="MLS"){ binary+="011110"; }else if(opcode=="MRT"){ - /* - TO BE COMPLETED FOR REGISTERS, ASK AADI - */ binary+="011111"; + rs1="R0"; + rs2="R0"; }else if(opcode=="LSL"){ binary+="100000"; }else if(opcode=="LSR"){ @@ -243,6 +242,15 @@ string getInstructionHex(string instruction){ binary+="100100"; }else if(opcode=="RRC"){ binary+="100101"; + }else if(opcode=="PSH"){ + binary+="101000"; + rs1=rd; + rd="R0"; + rs2="R0"; + }else if(opcode=="POP"){ + binary+="101001"; + rs1="R0"; + rs2="R0"; }else if(opcode=="NOP"){ binary+="111110"; rd="R0";