### Help me with this exam

Create a program for interpretation of a simple instruction set consisting of the instructions: MVI, MOV, AND, OR, NOT, LESS, LEQ, GRE, GEQ, JMP, PRN, SUM, SUB, PRB, SL and SR . Your task is to make a program that takes as an input a binary representation of a list of instructions, and as an output it prints the corresponding result (after the execution of the instructions). The input can contain all the instructions except SUM and PRB that you do not have to implement. Conversion from binary system to any other numeral system should not be made, except at the moment when you need to find the line that should be executed next when the condition is satisfied (GRE, GEQ, LESS, LEQ, JMP), but the comparison of the numbers in the condition should be made based on the binary representation. All data are represented in DC binary system. There are eight 16-bit registers available enumerated from 0 to 7.

 ``123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172`` `````` #include #include #define MAX 1000 using namespace std; char registers[8][16]; void MVI(int reg, char *value) { // your code here } void MOV(int reg1, int reg2) { // your code here } void AND(int reg1, int reg2, int reg3) { // your code here } void OR(int reg1, int reg2, int reg3) { // your code here } void NOT(int reg1, int reg2) { // your code here } void PRN(int reg) { // your code here } void SUB(int reg1, int reg2, int reg3) { // your code here } void SL(int reg) { // your code here } void SR(int reg) { // your code here } int main() { int i,j,k; int N = 0; // number of lines in the input char c; char lines[MAX][16]; while (1) { scanf("%c", &c); if (c == '\n') { break; } lines[N][0] = c; for (i=1;i<16;i++) { scanf("%c", &lines[N][i]); } N++; scanf("%c", &c); } for (i = 0; i < 8; i++) { for (j = 0; j < 16; j++) { registers[i][j] = '0'; } } // return 0; }``````
Topic archived. No new replies allowed.