Question: 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
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
