This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Reading C674x CPU registers values into an array using C/C++

Hi there,

I am trying to read ALL A0-31 and B0-31 C674x registers into an array to preserve their values and analyze them later all of this inside a NMI interrupt. I am trying to do this in C/C++.

To read the Control Register the keyword cregister can be used. Is it the same type of keyword for the A and B registers?

Thank you.

Regards.

Isidro  

  • Isidro,

    This is not a C-relevant type of thing to do. This is an assembly-relevant function.

    The SYS/BIOS Exception module has a feature that automatically prints all of these registers to the console when an exception (NMI) occurs. It puts all of the registers into a Context struct that you could access, if you did not want to use the standard console printout.

    I have never used this, but you should be able to read up on it in the SYS/BIOS reference documentation.

    Or if you need more help on that, let us know and we can have this thread moved to the BIOS Forum where they would be better at that.

    Please let us know if this helps.

    Regards,
    RandyP

  • Hi Randy,

     

    Thank you for your answer. I have read the SYS/BIOS documentation and I need more help about this.

    Please move the thread to the BIOS Forum.

    Again thank you for your help.

    Isidro

  • Isidro,

    You won’t be able to use the cregister keyword because that is only valid for control registers, not the general purpose A and B-side registers.  As Randy replied earlier, you’ll need an assembly language function to read an stash these register values away for later analysis.

    What additional questions do you have?

    Scott

  • Hi Scott,

    Yes, I find out what you explained in your reply.

    I also implemented a way to read all the registers, place them in memory and retrieve them later.

    Thank you for your response.

    Best regards.

    Isidro Alvarez