Answered step by step
Verified Expert Solution
Question
1 Approved Answer
There are two defines for task 3 , only define task 3 _ 1 initially when first working on the peekAddress ( ) and pokeAddress
There are two defines for task only define task initially when first working on the peekAddress and pokeAddress functions.
Implement the peekAddress and pokeAddress functions and pass the unit tests for those functions. These functions are tested by using poke to write a value somewhere in memory, then we peek the same address and see if we get the value we wrote to read back out again. Both of these functions should reuse the translateAddress function form the previous step. In both cases, you first start by translating the given address to a real address. Then for poke you need to save the indicated value into the correct location of your memory array. And likewise for peek, you need to read out a value from your memory array and return it
Once your memory peeks and pokes are working, you can try out the tests of the loadProgram function. This function needs to use your initializeMemory from task and the pokeAddress function you just created. Define the task tests in the test file. But also, the calls to initializeMemory and pokeAddress have been commented out of the loadProgram to get the code to compile. You should uncomment the calls to these function in the loadProgram member method, then see if the Task tests pass when loading full programs for the simulation.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started