--- nono/debugger/branchhistory.cpp 2026/04/29 17:04:43 1.1.1.1 +++ nono/debugger/branchhistory.cpp 2026/04/29 17:04:51 1.1.1.3 @@ -9,7 +9,6 @@ #include "branchhistory.h" #include "m68030core.h" #include "m88100.h" -#include "mystring.h" // コンストラクタ BranchHistory::BranchHistory() @@ -126,11 +125,14 @@ BranchHistory::MonitorUpdate(TextScreen& // ジャンプの3つを区別する。 // // 通常の分岐: -// from は分岐元 PC、to は分岐先 PC、inst の上位16ビットに命令の1ワード目。 +// from は上位31ビットが分岐元 PC、最下位ビットが S/U、 +// to は32ビット全体が分岐先 PC、 +// inst の上位16ビットに命令の1ワード目。 // inst の $8000 が立っていないことで区別する。 // // 例外発生: -// from は例外発生時の PC、to は不問(通常 0 をセットすること)、 +// from は上位31ビットが例外発生時の PC、最下位ビットが S/U、 +// to は不問(通常 0 をセットすること)、 // inst は $00008LVV で $8000 が例外フラグ、VV がベクタ番号である。 // ベクタ番号が $00 だと次項(ベクタによる分岐)と区別つかなくなってしまう // ため、リセット例外 (ベクタ番号0) は V=$01 で記録する。 @@ -138,7 +140,9 @@ BranchHistory::MonitorUpdate(TextScreen& // inst に $8000 が立っていて、かつ $8000 と一致しないことで区別する。 // // 例外ベクタによる分岐 (例外処理の最後に起きる): -// from はベクタアドレス、to は分岐先 (0 も起こりえる)、inst は $00008000。 +// from はベクタアドレス、 +// to は分岐先 (0 も起こりえる)、 +// inst は $00008000。 // inst が $00008000 と一致することで区別する (ビットが立っているではない)。 // コンストラクタ @@ -221,11 +225,15 @@ BranchHistory_m680x0::FormatEntry(const // m88k は例外ベクタを直接実行するのでそれは不要。 // // 通常の分岐: -// from は分岐元 XIP、to は分岐先アドレス、inst は命令ワード。 +// from は上位30ビットが分岐元 XIP、最下位ビットが S/U、 +// to は32ビット全体が分岐先アドレス、 +// inst は命令ワード。 // // 例外発生: -// from は例外発生時の XIP、to は 0。inst は $fc000VVV で VVV (9ビット)が -// ベクタ番号。命令ワードとは衝突しない (instruction.txt 参照)。 +// from は上位30ビットが例外発生時の XIP、最下位ビットが S/U、 +// to は 0。 +// inst は $fc000VVV で VVV (9ビット)がベクタ番号。 +// 命令ワードとは衝突しない (instruction.txt 参照)。 // コンストラクタ BranchHistory_m88xx0::BranchHistory_m88xx0() @@ -266,7 +274,7 @@ BranchHistory_m88xx0::FormatEntry(const case 3: mnemonic = ":bsr.n"; break; case 4: mnemonic = ":bb0"; break; case 5: mnemonic = ":bb0.n"; break; - case 6: mnemonic = ":bb1"; break; + case 6: mnemonic = ":bb1"; break; case 7: mnemonic = ":bb1.n"; break; case 0xa: mnemonic = ":bcnd"; break;