Hello,

I've written a program that mimics a 32-bit MIPS processor. It does a couple of instructions. It works by reading in a Hexadecimal instruction of length 8 and then carrying out the instruction and writing the information to a file. It was working fine earlier but now I get an out of subscript range error when it encounters the third instruction. From my experience I know that that means I'm accessing a location that is not allocated. For some reason memory[ 0 ] is being wiped out. Please help as this is very annoying. I have uploaded the files. I'm using Microsoft Visual Studios

Use your compiler's debugger and step through the program one line at a time.

Use your compiler's debugger and step through the program one line at a time.

How do you do that? Sorry for the ignorance.

Figured out the issue. The issue was my BinToDec function. I had a 1 instead of i. Problem solved!!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.