asm

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

asm

3,310 Views
yueli
NXP Employee
NXP Employee

How can I use asm in the S32DS?

152717_152717.JPGCapture.JPG

Labels (2)
4 Replies

2,521 Views
stanish
NXP Employee
NXP Employee

If you don't want to add prefix "%" when referring to the core registers you can add the compiler switch -Wa,-mregnames.

pastedImage_0.png

Now your inline asm statements like asm("e_li r3,0") should be accepted.

Hope it helps.

Stan

2,521 Views
martin_kovar
NXP Employee
NXP Employee

Hi,

instead of NOP instruction you can use one of these:

asm("e_ori 0,0,0");

asm("e_nop");

If you want to read/write from/to registers r0-r31, you have to use %.

asm("mtspr 268,%r3 ");

asm("mfspr %r3, 268 ");

Also e_li instruction has to have this format:

asm("e_li %r3,0 ");

Regards,

Martin

0 Kudos
Reply

2,521 Views
yueli
NXP Employee
NXP Employee

Thank you Martion,

Do you have the doc of e200z420? Dose e200z420 have the time base register? Because when I execute "asm("mtspr 284, %%r3 \n\t"::);", it will occur IVOR6 exception.

void GetTBL_start(void)

{

/****************

// Clear Timebase

****************/

  asm("e_li %%r3, 0 \n\t"::);

  asm("mtspr 284, %%r3 \n\t"::);

/* read tbl  */

  asm("mfspr %%r3, 268 \n\t"::);  /* TBL */

}

0 Kudos
Reply

2,521 Views
martin_kovar
NXP Employee
NXP Employee

Hi,

e200z420 does not contain time base register. This feature is not implemented in the core. I have e200z420 core reference manual, but I cannot share it here, because it is confidential.

But if you need it, please create case and some responsible person will send you the manual.

https://community.nxp.com/docs/DOC-329745

Regards,

Martin

0 Kudos
Reply