your own, for editing. Spend some time trying to see what it does. The parts

This question uses the MARS MIPS simulator. The goal is to write a loop in assembly that converts hexadecimal numbers into UTF-8 binary sequences. The details are as follows: You should copy-and-paste the file lab2.txt into the MARS editor, and then save the file as your own, for editing. Spend some time trying to see what it does. The parts that need to be changed in main are between the comment lines Your part starts here and Your part ends here. You should also add more lines to the register assignment table, to describe what you did. Additional comments will probably be helpful. There are also two character strings that need to be changed, to put your names in the output. Here are the Mars Messages and Run I/O panels, after assembling and running the starter program: Assemble: assembling /Β…/lab2.asm Assemble: operation completed successfully. Go: running lab2.asm Go: execution completed successfully. 0 0x00000000 0x00000003 00000000000000000000000000000000 00000000000000000000000000000011 1 0x00000024 0x00000003 00000000000000000000000000100100 00000000000000000000000000000011 2 0x0000007e 0x00000003 00000000000000000000000001111110 00000000000000000000000000000011 3 0x0000007f 0x00000003 00000000000000000000000001111111 00000000000000000000000000000011 4 0x00000080 0x00000003 00000000000000000000000010000000 00000000000000000000000000000011 5 0x000000a2 0x00000003 00000000000000000000000010100010 00000000000000000000000000000011 6 0x00000627 0x00000003 00000000000000000000011000100111 00000000000000000000000000000011 7 0x000007ff 0x00000003 00000000000000000000011111111111 00000000000000000000000000000011 8 0x00000800 0x00000003 00000000000000000000100000000000 00000000000000000000000000000011 9 0x000020ac 0x00000003 00000000000000000010000010101100 00000000000000000000000000000011 10 0x00002233 0x00000003 00000000000000000010001000110011 00000000000000000000000000000011 11 0x0000ffff 0x00000003 00000000000000001111111111111111 00000000000000000000000000000011 12 0x00010000 0x00000003 00000

πŸ’‘ Buy the answer for only $12 Get it now β†’

000000000010000000000000000 00000000000000000000000000000011 13 0x00010348 0x00000003 00000000000000010000001101001000 00000000000000000000000000000011 14 0x00022e13 0x00000003 00000000000000100010111000010011 00000000000000000000000000000011 15 0x0010ffff 0x00000003 00000000000100001111111111111111 00000000000000000000000000000011 16 0x89abcdef 0x00000003 10001001101010111100110111101111 00000000000000000000000000000011 All done! Β— program is finished running Β– The idea behind UTF-8 is to augment a character code with some additional bits to protect against certain kinds of communication failures. Here is the standard diagram: The term Β“octetΒ” means Β“8 bitsΒ”, which everyone now thinks of as one byte. There were once computers whose byte size was not 8 bits, but they are all gone now. In the starter version provided, we used the variable j instead of code_point. Each case should compute n from j. ItΒ’s going to be a lot easier if you sketch the solution in C, and then rewrite it into MIPS assembler, inserting the C version as a comment. Start with the if-then-else structure, and test that with some bogus values for n. Then, write each of the five cases separately; two of these are trivial, and the other three have a lot of features in common. The MIPS assembly code is slightly easier to write if all the tests are < instead of a mixture of < and <= . Also, treat the registers as if they contain unsigned integers (when using a numeric instruction) or simple bit strings (when using logical and shift instructions). In case 1, j fits in 7 bits, and it is expanded to 8 bits with a leading 0 bit, which yields the same value. In case 5, it's an error, so n is -1 or 0xFFFFFFFF; that's not the proper treatment of errors according to UTF-8, but it's certainly easier. The following comments describe how the bits of j are to be rearranged to form the bits of n. Here is the output from a correct solution, using MARS: You are finished when you are satisfied that your program works and runs efficiently.

πŸ’‘ Buy the answer for only $12 Get it now β†’