Simple simulation of a microprocessor system (HELP!)

How much sense does this make to anyone, i have been learning c++ for 8 weeks now and i been given two weeks to complete the fist part of my assignment which is below. The teacher is of no use and cant seem to explain anything, where would a good place to start be, i have been trying to use seperate header files for the different parts. Just seem to be getting more and more confused by it all, i certainly dont want the complete answer but some code to start me off would be great, so i can build on it.

Develop a series of classes that can be used together to provide a simple simulation of a microprocessor system comprising as a minimum a CPU, with its internal registers, and operations to fetch and execute instructions and Flash ROM which holds the program instructions.

The CPU should have four internal registers and the following instruction types:

All instructions are encoded as a three single digit numbers d1d2d3 :-
The first digit is the op-code, the next two digits are operands for the instruction. If the instruction only requires a single register then it is the last digit. If any operands are not required then the digit value is zero.

• void program(int p[]) - function receives an array (or could be done using a pointer to an array) of values terminating
with the HALT instruction. The purpose of this function is to read in the complete program and store it in the FlashROM
• void erase() - erase all Flash ROM contents.
• int read(int location) - return contents of the given location.

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

The CPU should have the four registers (sounds like an array to me) as well as an instruction pointer and an instruction register (adding a couple of bookkeeping registers to the 4; I would not put the ip or instruction register in the array). Then execution of a program is "simple":

Since you have been given the interface for the FlashROM I would design that class. Where will you store the contents of the ROM? What data members will the FlashROM need? You'll of course need to be able to create and destroy FlashROMs. I would suggest writing a routine that will print the contents of the FlashROM on the screen. That way you can test the FlashROM without writing a CPU at all. Just have a main that looks something like this:

I have been thinking about this (I wrote a very similar simulator back in my undergraduate days and have assigned this sort of thing before). I think writing a FlashROM class based on some simple container is your best way to start. Each memory location has to contain an int so you should have a container that holds ints at the heart of the class.

If you need any C++ concepts explained (you complained about the instructor; my condolences), ask about them.