cancel
Showing results for 
Search instead for 
Did you mean: 

unexpected jump

epassoni9
Associate II
Posted on October 26, 2009 at 05:31

unexpected jump

5 REPLIES 5
epassoni9
Associate II
Posted on May 17, 2011 at 15:05

What happens if the program counter goes to a location loaded with 0x00?

(for example,I know that if the location contains a ''nop'' op-code it goes to the next location.)

Since the 0x00 is not an op-code,what happens ? thanks! :)

Thanks

Spectre

p.s. I have already read the an on the emc interferences

brazov2
Associate II
Posted on May 17, 2011 at 15:05

Hi,

if the micro decodes and illegal opcode, you'll get an illegal opcode reset. Check the status register of the reset controller to see reset source.

Coluber

epassoni9
Associate II
Posted on May 17, 2011 at 15:05

Dear brazov2,

I didn't understand your answer.I know that I can check the reset source but I have mentioned the emc application note only because I have read on it the illegal op-codes list.

I agree with you that if the program counter pointer goes on a illegal op-code I'll get an mcu reset.But I'm interested about a block filled with 0x00.

regards

Spectre

[ This message was edited by: spectre on 23-10-2009 14:19 ]

brazov2
Associate II
Posted on May 17, 2011 at 15:05

Hi spectre,

can you better specify the problem you want to solve? If you want to remove illegal byte 00h from your code and you have a block of all zeros, perhaps you can simply fill it with TRAP opcode (83h) to keep a better control of unexpected jumps instead of getting an illegal opcode reset.

coluber

epassoni9
Associate II
Posted on May 17, 2011 at 15:05

Dear brazov2,

I have solved my issue.

(I was not sure that 0x00 is an illegal opcode.)

regards

Spectre :)