Answered step by step
Verified Expert Solution
Link Copied!

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 3, only define task3_1 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 1, and the pokeAddress() function you just created. Define the task3_2 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 3.2 tests pass when loading full programs for the simulation.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Database Relational Model A Retrospective Review And Analysis

Authors: C. J. Date

1st Edition

0201612941, 978-0201612943

More Books

Students also viewed these Databases questions