Andes Workshop
http://forum.andestech.com/

lbi $r0, [$r0+0] (全部為0的指令)(ALZ用途)
http://forum.andestech.com/viewtopic.php?f=14&t=539
Page 1 of 1

Author:  cindy [ Wed Feb 22, 2012 12:15 pm ]
Post subject:  lbi $r0, [$r0+0] (全部為0的指令)(ALZ用途)

0x00000000在Andes Core裡也是一個指令,
lbi $r0, [$r0+0]

如果user希望在00000000發生時通知,(因為可能有異常)
可以打開ALZ這個bit。

以下是ISA manual裡的說明:
“LBI R0, [R0+0]” baseline version 2 special behavior –
This instruction will become a Reserved instruction when the INT_MASK.ALZ (INT_MASK[29]) is set to one. INT_MASK is also named as ir14. This special behavior can be used to debug a system. When this special behavior is used, compiler and assembler should avoid generating this instruction.

下面是SPA Manual裡的說明。
Attachment:
alz1.gif
alz1.gif [ 46.82 KiB | Viewed 13903 times ]


Attachment:
alz2.gif
alz2.gif [ 21.53 KiB | Viewed 13903 times ]


ALZ 是提供一個特殊目的 debug 工具, 設計的用途是如果程式不明原因亂跑時, 如果執行到 All Zero Opcode reserved instruction (0x00000000), 可以盡快產生 exception. 否則如果程式亂跑又 fetch 到的 code 是 All Zero Opcode (一般 padding data 會塞 0x00 or 0xff ), 程式會視為正常狀況而繼續執行. 所以user可能無法知道程式的錯誤點.

但是, All Zero Opcode 也是一個合法指令 (LBI R0, [R0+0]), 因此在正常的 program 下, ALZ bit 是要 disable. 否則會造成一遇到lbi $r0, [$r0+0]就發exception。如果沒有特殊情形,建議把 ALZ disable.

Page 1 of 1 All times are UTC + 8 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/