You are to write an emulator for the y86 instruction set using the C programming language. The y86 architecture is a very small subset of the x86 instruction set which performs many of the essential functions of x86 and which is useful for teaching and research purposes. I've included a number of documents about y86 which has all the essential details about the architecture, including a chapter from the textbook for which the instruction set was developed.
Emulator should read in a text file that contains only the opcode bytes representing the program. The file will be plain ASCII text file representing the bytes in either lower or uppercase (expect to see "30f4b8" or "30F4B8"). You can assume the file contains no spaces or line breaks, only characters representing the program's bytes. Your emulator should verify the input from one of my test programs is valid. Use the test program (that I will provide) to create a test program of your own. Some others can be found online (the authors of that book have a number of them). Load the program into memory starting from the first byte of memory (memory address 0). Your emulator should run the program completely and output the final state of the registers, the program counter, and the condition flags.