The simulator will bootstrap (i.e., start itself up into a state) by loading a passed object file into the code area and a passed file’s contents into the data area. Your simulator will accept two parameters, the first is the object file and the second is the data file. In addition to the interface described above, your implementation should do the following: All registers are initialized to 0x0000 at startup. Make sure all negative values are correctly sign extended. The program counter (PC) is incremented after the execution of an instruction. Your simulator should always complete. To handle infinite loops, define some (large) maximum loop count. Clearly document this. All operations and data accesses are word aligned. Be careful, since everything involves 2 bytes, not 1 (which leads to the next point…) All values (data, etc) are big endian. Note that this doesn’t mean everything has to be big endian internally; you just have to make sure you deal with memory such that it is big endian (especially when displayed). Make sure you interpret the machine instructions carefully, the bit ordering is very important (see machine code below). Your data area should be initialized to contain all 0xFFs prior to loading the passed data file. The data file is an ASCII file of hex digits. The code to load the data has been written for you (see void insert_data( string line );). Your simulator must accurately reflect the instruction execution cycle discussed in our review. Take a look at the control unit state machine, and use start.cpp to start your implementation.
Get Free Quote!
268 Experts Online