hi, i need help with self modifying code.
the assignment is to actually write a calculator program. it basically takes some input binary,decimal,hex and does 4 operations +,-,*,/ but there is a special case where when the result is 7 the program will modify itself so that from then on entering addition will instead give the logical AND of the two operands.
I dont know anything about self modification.
mips, self modifying code
Moderator: cheriff
mips, self modifying code
Last edited by ramaz on Fri Oct 03, 2008 6:01 am, edited 1 time in total.
Okay, that's better. :)
Look up the opcodes you'll need (in the manual I mentioned). Look at the hex values... you'll need to store the code over top of the old code, flush the data cache to make sure the value is written to memory, then invalidate the code cache to make sure the CPU fetches the new code from memory instead of the cache.
Look up the opcodes you'll need (in the manual I mentioned). Look at the hex values... you'll need to store the code over top of the old code, flush the data cache to make sure the value is written to memory, then invalidate the code cache to make sure the CPU fetches the new code from memory instead of the cache.