asm

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

asm

3,347件の閲覧回数
yueli
NXP Employee
NXP Employee

How can I use asm in the S32DS?

152717_152717.JPGCapture.JPG

ラベル(2)
タグ(4)
4 返答(返信)

2,558件の閲覧回数
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,558件の閲覧回数
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 件の賞賛
返信

2,558件の閲覧回数
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 件の賞賛
返信

2,558件の閲覧回数
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 件の賞賛
返信