mirror of
https://github.com/supleed2/ELEC40006-P1-CW.git
synced 2024-11-10 02:05:48 +00:00
Updated instruction generator to include new opcodes
This commit is contained in:
parent
9a1a1da664
commit
0b1ffea9ce
|
@ -229,10 +229,9 @@ string getInstructionHex(string instruction){
|
||||||
}else if(opcode=="MLS"){
|
}else if(opcode=="MLS"){
|
||||||
binary+="011110";
|
binary+="011110";
|
||||||
}else if(opcode=="MRT"){
|
}else if(opcode=="MRT"){
|
||||||
/*
|
|
||||||
TO BE COMPLETED FOR REGISTERS, ASK AADI
|
|
||||||
*/
|
|
||||||
binary+="011111";
|
binary+="011111";
|
||||||
|
rs1="R0";
|
||||||
|
rs2="R0";
|
||||||
}else if(opcode=="LSL"){
|
}else if(opcode=="LSL"){
|
||||||
binary+="100000";
|
binary+="100000";
|
||||||
}else if(opcode=="LSR"){
|
}else if(opcode=="LSR"){
|
||||||
|
@ -243,6 +242,15 @@ string getInstructionHex(string instruction){
|
||||||
binary+="100100";
|
binary+="100100";
|
||||||
}else if(opcode=="RRC"){
|
}else if(opcode=="RRC"){
|
||||||
binary+="100101";
|
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"){
|
}else if(opcode=="NOP"){
|
||||||
binary+="111110";
|
binary+="111110";
|
||||||
rd="R0";
|
rd="R0";
|
||||||
|
|
Loading…
Reference in a new issue