divide division exception IVOR0 for MPC5777C

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

divide division exception IVOR0 for MPC5777C

ソリューションへジャンプ
2,700件の閲覧回数
20Sidar04
Contributor III

Dear Mr./Mrs,

I try to understand IVOR0. When I set  MSR bit by using source code as follow.

static void SetMSR_ME(void)
{
/* read spr MSR */
PPCASM (" mfmsr %r3 ");

/* load mask to assert the ME bit */
//lis r4, 0x0000
//addi r4, r4, 0x1000
PPCASM (" e_lis %r4, 0x0000 ");
PPCASM (" e_add16i %r4, %r4, 0x1000 ");


/* set ME bit */
//or r3, r3, r4
PPCASM (" se_or %r3, %r4 ");


/* write back to MSR */
PPCASM (" mtmsr %r3 ");

}

But I divide integer variable by zero on runtime. During debugging my source not stop at void IVOR0_Exception_Handler(void). Where could be problem? I wonder that. I read a post on forum like that there is not exception for e200z6. Is it same with e200z7. 

Best regards.

タグ(3)
0 件の賞賛
返信
1 解決策
2,687件の閲覧回数
davidtosenovjan
NXP TechSupport
NXP TechSupport

Integer divide by zero does not lead in exception, it is saturated.

davidtosenovjan_0-1644393078213.png

 

 

元の投稿で解決策を見る

0 件の賞賛
返信
5 返答(返信)
2,688件の閲覧回数
davidtosenovjan
NXP TechSupport
NXP TechSupport

Integer divide by zero does not lead in exception, it is saturated.

davidtosenovjan_0-1644393078213.png

 

 

0 件の賞賛
返信
2,339件の閲覧回数
Andrewkangddac
Contributor I

how can I get  MPC57XX  ppcasm Reference

0 件の賞賛
返信
2,668件の閲覧回数
20Sidar04
Contributor III

Dear David,

thanks for answer.  I have last question about this question. Dividing of integer don't cause exception. Does it same for mode 0 of integer variable such as 10%0. 

Best Regards.

タグ(1)
0 件の賞賛
返信
2,656件の閲覧回数
davidtosenovjan
NXP TechSupport
NXP TechSupport

Just noting IVOR0 can only be generated with using of NMI input

davidtosenovjan_0-1644575069777.png

 

0 件の賞賛
返信
2,658件の閲覧回数
davidtosenovjan
NXP TechSupport
NXP TechSupport

There is no dedicated instruction for integer modulo.

It is done by sequence of instructions divw, mullw and subf

1) quotient = divident / divisor

2) remainder = divident - (quotient * divisor)

0 件の賞賛
返信