Question: The following program is a part of the skeleton program for Project #1. else if (strnemp/token[0], add, 3) ==0) { // token[0]=add, token[1]=$1,52,53, for example

The following program is a part of the skeleton program for Project #1. else if (strnemp/token[0], "add", 3) ==0) { // token[0]="add", token[1]="$1,52,53", for example opcode=0; shamt-0; fune = 32; // now, token[1] is split into three pieces rd_str = strtok(token[1], "$"); s str = strtok(NULL, "S"); rt_str = strtok(NULL, "S"); rd-atoi(rd_str); Is-atoirs str); rt-atoirt_str); // the next step is put those pieces together to encode a 32-bit instruction instruction - (opcode
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
