Priyajit Ghosh
Priyajit Ghosh

Reputation: 5

Trace32 CMM script : understanding the shift operator

Please check bellow cmm script code, it is throwing error:- If anyone knows the answer please comment.

&MY_DATA=Data.LONG(ANC:0x300007FF9C8ABC)
&CHECK_VAL=&MY_DATA&(1<<&BITPOS) ;this should work
IF (&CHECK_VAL==(1<<&BITPOS)) ;this should work

error massage was:- IF (&CHECK_VAL==(1<<&BITPOS)) ^symbol not found

Upvotes: 0

Views: 160

Answers (1)

Holger
Holger

Reputation: 4183

In general your script should work. I assume that your macro &BITPOS does not contain a numeric value.

I suggest debugging your PRACTICE script. To do so:

  1. Open a new PRACTICE editor: Menu > File > New script
  2. Paste your code to the opened PEDIT window. (Ensure that &BITPOS is also defined in that code.)
  3. Click on the button "Debug" in the top of the PEDIT window. The window PLIST opens, in which you can debug your code.
  4. Click on the button "Macro" in the top of the PLIST window, which opens the window PMACRO showing you the values of your script macros/variables while stepping through your script.
  5. Click on the button "Step" in the top of the PLIST window to execute one line after another of your script. Check the content of PMACRO while stepping through your script.

What is the content of &BITPOS right before stepping over the line causing the error?

Upvotes: 0

Related Questions