Write a C program to read a vm611 object file, translate the code to Intel IA-32 instructions, and execute the translated code.
The name of the vm611 object file will be provided as the only argument on the command line.
Before executing the translated code, print the translated code to stderr. For each vm611 instruction in the input, print the nibble address of the vm611 instruction in hex, followed by a colon, followed by the corresponding Intel instructions displayed as a series of hex bytes, followed by a newline. The Intel instruction bytes should be displayed in increasing address order.
For example, if the vm611 program is:
push 190
push 170
add
Then you would output:
0: 68 be 00 00 00
4: 68 aa 00 00 00
8: 5a 58 01 d0 50
Note: it is coincidence that all these output lines are the same length.
Put all your code in the file called "jit.c".
Your program will be graded primarily by testing it for correct functionality:
Note: no support is required for the pushind or popind instructions.
Also note: you must first do the 75% level, then the 10% level, then the 15% level.
Remember, you may lose points if your program is not properly structured or adequately documented. See the mandatory guidelines given in the course overview webpage.
Your programs will be graded using an Linux/Intel machine so be sure to test in that environment.
Your program should be submitted for grading from a UNH
CIS Linux/Intel machine (e.g. turing.unh.edu).
Submit only the file "jit.c".
To turn in this assignment, type:
~cs611/bin/submit prog4 jit.c
Do not turn in any other files!
Notes:
Submissions can be checked by typing:
~cs611/bin/scheck prog4
To receive full credit for the assignment, you must turn in your files prior to 8am on Monday November 1. Programming assignments may be handed in late at a penalty of 2 points for one day late, 5 points for two days late, 10 points for three days late, 20 points for four days late, and 40 points for five days late. No program may be turned in more than 5 days late.
Remember: as always you are expected to do your own work on this assignment.
Comments and questions should be directed to hatcher@unh.edu