0x200 + (0x02 << 1) = 0x204
No, you don't need to translate VM to PM in system mode, and if you don't translate, you don't need to change the PTE's at system mode.
No, you don't need to translate.
We prefer txt, pdf, ps file formats. You can submit jpg, or bmp file format for figures.
If you feel that a word document (or any other format) is more convenient, make sure that you convert it into a form which can be viewed on unix . An easy way of doing this is to print the word document, and choose the "print to file" option - this will create a postscript file which can be viewed on unix.
Reference and modified bits of the PTE should be changed only if the address translation is successful (i.e. only if there are no exceptions during address translation).
You should initialize the privilege mode of the processor (PSR[15]) to 1 (user mode) in your simulator.
You can assume that RTI will never be used by a user program. You are not responsible for generating an exception if an RTI instruction is encountered in user mode.
User stack pointer is initialized in the user program (if the user program makes use of the stack).
For the purposes of this assignment, you can assume this.
No. It occurs only once at cycle 500.
Yes, it should clear the reference bits of all virtual pages.
The elements your user program is supposed to add are words. You should store the sum of the 20 16-bit two's complement integers as a word at location xC014.
Initialize the modified and reference bits to 0.
void mdump(FILE * dumpsim_file, int start, int stop) { int address; /* this is a byte address */ printf("\nMemory content [0x%0.4x..0x%0.4x] :\n", start, stop); printf("-------------------------------------\n"); for (address = (start >> 1); address <= (stop >> 1); address++) printf(" 0x%0.4x (%d) : 0x%0.2x%0.2x\n", address << 1, address << 1, MEMORY[address][1], MEMORY[address][0]); printf("\n"); /* dump the memory contents into the dumpsim file */ fprintf(dumpsim_file, "\nMemory content [0x%0.4x..0x%0.4x] :\n", start, stop); fprintf(dumpsim_file, "-------------------------------------\n"); for (address = (start >> 1); address <= (stop >> 1); address++) fprintf(dumpsim_file, " 0x%0.4x (%d) : 0x%0.2x%0.2x\n", address << 1, address << 1, MEMORY[address][1], MEMORY[address][0]); fprintf(dumpsim_file, "\n"); }
Please dump the contents of location x3814.