Question: Write a C program (MachineCode.c) to convert any R - format MIPS instructions in to machine codes. Refer to the MIPS reference sheet to find
Write a C program (MachineCode.c) to convert any R - format MIPS instructions in to machine codes. Refer to the MIPS reference sheet to find out all the possible operators your program will need to implement.
You must not use any library other than stdio.h, string.h, and stdlib.h
You program must produce the following sample results in the exact same format:
Sample results: Enter an R - format instruction:
add s1, t0, t1
Operation: add
Rs: t0 (R8)
Rt: t1 (R9)
Rd: s1 (R17)
Shamt: 0
Funct: 32
Machine code: 00000001000010011000100000100000
Enter an R - format instruction:
jr ra
Operation: jr
Rs: ra (R31)
Rt: 0 (R0)
Rd: 0 (R0)
Shamt: 0
Funct: 8
Machine code:
00000011111000000000000000001000
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
