user4082317
user4082317

Reputation: 11

When disassembling a DSP program, how to know whether the 32-bit data is an instruction or not?

I loaded a program using Code Composer Studio 3.3, and through the diassembly window we can see something like this:

00000C5C  00000000            NOP 
00000C60  DD7ABCD2            .word         0xdd7abcd2       

The first column means PC, the second column means the 32-bit data in the corresponding memory, and the last column means the instruction if CCS3.3 think so.

Apparent in the second line, CCS3.3 don't think this is an instruction.But it can be translated to a correct instruction, so I am wondering how does CCS3.3 decide whether to translate the 32-bit data into an instruction or not? Thank you.

Upvotes: 0

Views: 97

Answers (1)

Van Uitkon
Van Uitkon

Reputation: 356

Every value is a instruction and a variable. Values that are used as variables could theoretically also be used as instructions (however this makes rarely no sense and when it's done wrong, it would cause an exception).

  • A way to find out, which value is used as an instruction, is emulation. Places, which can be reached while running the program, are instructions.
  • Another way to find out, is to analyze, which sections are writeable and readable and which are executable (but there are also sections which are both). But if a section is not executeable, this isn't sure, that this values won't ever be used as code, because the program (or an included DLL) could copy that values to an executeable section and jump there.
  • A third way, is to analyze which values would cause an exception (due to invalid opcodes, for example). But that isn't always clear, because that values could also be used as variables.

Upvotes: 0

Related Questions