How to set program counter to illegal address while code is running ?

Discussion in 'Embedded Systems and Microcontrollers' started by naseeam, Jun 20, 2017.

  1. naseeam

    Thread Starter New Member

    Jan 4, 2017
    13
    0
    I'm trying to create illegal instruction reset.

    I'm programming Infineon TC29x Aurix Tricore Microcontroller based embedded system in 'C' language.

    I need to set program counter to illegal address, i.e. 0x00FF FFFC. Can this be done with assembly language instructions?
    If yes, please instrument assembly language instruction that would set program counter to 0x00FF FFFC while code is running.
     
  2. BR-549

    AAC Fanatic!

    Sep 22, 2013
    4,067
    1,059
    Not familiar with your setup. Why is it an illegal address?
     
  3. djsfantasi

    AAC Fanatic!

    Apr 11, 2010
    3,538
    1,285
    Because he wants it to be an illegal address. Apparently, an illegal address causes some reset code to be executed and he is trying to manually execute something at an illegal address.
     
    naseeam likes this.
  4. nsaspook

    AAC Fanatic!

    Aug 27, 2009
    4,821
    5,217
    You can do something like this in C.
    Code (C):
    1.  
    2. typedef int(*funptr)(constchar*,char);
    3. funptr ShowPopupMessage;
    4.  
    5. ShowPopupMessage=(funptr) your_address_goes_here; // illegal address
    6.  
    7. ShowPopupMessage("hello",0); // call illegal address trap
    8.  
     
    naseeam, djsfantasi and JohnInTX like this.
Loading...